Commit 4426b8c
authored
guard bundled tbb against gcc cpuid.h / mingw intrin.h conflict (#248)
GCC's <cpuid.h> defines a function-like '__cpuid' macro. If a downstream
package includes <cpuid.h> before any TBB header on Windows (mingw), the
macro mangles the __cpuid() declarations in mingw's <intrin.h>, which
oneTBB's detail/_machine.h includes, and compilation fails, e.g.:
intrin-impl.h:2013:42: error: macro "__cpuid" requires 5 arguments, but only 2 given
Suppress the macro via push_macro/pop_macro while including <intrin.h>,
so the two headers can coexist in any include order. Record the change
in patches/mingw_cpuid.diff so it can be reapplied on oneTBB updates.
This was observed in the wild with the 'robscale' package on r-universe:
https://github.com/r-universe/cran/actions/runs/30028399599/job/893351447531 parent fbaeabb commit 4426b8c
3 files changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
29 | 39 | | |
| 40 | + | |
| 41 | + | |
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
| |||
0 commit comments