File tree Expand file tree Collapse file tree
src/tbb/include/oneapi/tbb/detail Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 RcppParallel 6.0.0, such packages would fail to load with "LoadLibrary
88 failure: The specified module could not be found".
99
10+ * The bundled oneTBB headers now guard against GCC's ` <cpuid.h> ` being
11+ included before ` <intrin.h> ` on Windows (mingw). Previously, translation
12+ units including ` <cpuid.h> ` before any TBB header would fail to compile,
13+ as the ` __cpuid ` macro from ` <cpuid.h> ` conflicts with the ` __cpuid() `
14+ function declared by mingw's ` <intrin.h> ` .
15+
1016* When building the bundled copy of oneTBB, RcppParallel no longer searches
1117 for hwloc, and so no longer tries to build the optional 'tbbbind' library.
1218 This fixes build failures on machines where a static hwloc library is
Original file line number Diff line number Diff line change 1+ diff --git a/src/tbb/include/oneapi/tbb/detail/_machine.h b/src/tbb/include/oneapi/tbb/detail/_machine.h
2+ index ca481380..8174f3d3 100644
3+ --- a/src/tbb/include/oneapi/tbb/detail/_machine.h
4+ +++ b/src/tbb/include/oneapi/tbb/detail/_machine.h
5+ @@ -26,7 +26,19 @@
6+ #include <cstddef>
7+
8+ #ifdef _WIN32
9+ +
10+ + // GCC's <cpuid.h> defines a function-like '__cpuid' macro that mangles the
11+ + // __cpuid() declarations in mingw's <intrin.h>. Hide the macro while
12+ + // including <intrin.h> so the two headers can coexist in any order.
13+ + #if defined(__MINGW32__) && defined(__cpuid)
14+ + #pragma push_macro("__cpuid")
15+ + #undef __cpuid
16+ + #include <intrin.h>
17+ + #pragma pop_macro("__cpuid")
18+ + #else
19+ #include <intrin.h>
20+ + #endif
21+ +
22+ #ifdef __TBBMALLOC_BUILD
23+ #define WIN32_LEAN_AND_MEAN
24+ #ifndef NOMINMAX
Original file line number Diff line number Diff line change 2626#include < cstddef>
2727
2828#ifdef _WIN32
29+
30+ // GCC's <cpuid.h> defines a function-like '__cpuid' macro that mangles the
31+ // __cpuid() declarations in mingw's <intrin.h>. Hide the macro while
32+ // including <intrin.h> so the two headers can coexist in any order.
33+ #if defined(__MINGW32__) && defined(__cpuid)
34+ #pragma push_macro("__cpuid")
35+ #undef __cpuid
36+ #include < intrin.h>
37+ #pragma pop_macro("__cpuid")
38+ #else
2939#include < intrin.h>
40+ #endif
41+
3042#ifdef __TBBMALLOC_BUILD
3143#define WIN32_LEAN_AND_MEAN
3244#ifndef NOMINMAX
You can’t perform that action at this time.
0 commit comments