Skip to content

Commit 38334d7

Browse files
committed
TBB patch: don't #define min
1 parent 2b436cf commit 38334d7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/tbb/src/tbb/tools_api/ittnotify_static.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,8 @@ static const char* __itt_get_lib_name(void)
806806
return lib_name;
807807
}
808808

809-
#ifndef min
810-
#define min(a,b) (a) < (b) ? (a) : (b)
811-
#endif /* min */
812-
809+
/* PATCH: Avoid stomping on 'min()' definition */
810+
#define RCPP_PARALLEL_TBB_MIN(a, b) (a) < (b) ? (a) : (b)
813811
static __itt_group_id __itt_get_groups(void)
814812
{
815813
int i;
@@ -825,7 +823,7 @@ static __itt_group_id __itt_get_groups(void)
825823
while ((group_str = __itt_fsplit(group_str, ",; ", &chunk, &len)) != NULL)
826824
{
827825
__itt_fstrcpyn(gr, chunk, sizeof(gr) - 1);
828-
gr[min(len, (int)(sizeof(gr) - 1))] = 0;
826+
gr[RCPP_PARALLEL_TBB_MIN(len, (int)(sizeof(gr) - 1))] = 0;
829827

830828
for (i = 0; group_list[i].name != NULL; i++)
831829
{
@@ -855,6 +853,7 @@ static __itt_group_id __itt_get_groups(void)
855853

856854
return res;
857855
}
856+
#undef RCPP_PARALLEL_TBB_MIN
858857

859858
static int __itt_lib_version(lib_t lib)
860859
{

0 commit comments

Comments
 (0)