Skip to content

Commit f527e6a

Browse files
committed
tbb: Backward compatibility based on __TBB_tbb_stddef_H
`__TBB_tbb_stddef_H` is defined in `tbb/tbb_stddef.h`, which has been removed in the new TBB interface.
1 parent 193b3b6 commit f527e6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
extern "C" SEXP defaultNumThreads() {
1212
SEXP threadsSEXP = Rf_allocVector(INTSXP, 1);
13+
#ifndef __TBB_tbb_stddef_H
1314
INTEGER(threadsSEXP)[0] = tbb::global_control::default_num_threads();
15+
#else
16+
INTEGER(threadsSEXP)[0] = tbb::task_scheduler_init::default_num_threads();
17+
#endif
1418
return threadsSEXP;
1519
}
1620

0 commit comments

Comments
 (0)