Open JBlaschke opened 1 year ago
I am generating the bindings for Hwloc_jll, and I encountered a few edge cases that I thought you might like to know about -- all of these have straightforward workarounds, so this isn't urgent here.
hwloc.h uses INT_MAX:
hwloc.h
INT_MAX
#define HWLOC_TYPE_UNORDERED INT_MAX
requiring the inclusion of something like:
const INT_MAX = typemax(Int64)
hwloc.h defines:
#define HWLOC_UNKNOWN_INDEX (unsigned)-1
which Clang.jl translated to:
Clang.jl
const HWLOC_UNKNOWN_INDEX = unsigned - 1
I replaced this line with:
const HWLOC_UNKNOWN_INDEX = INT_MAX
instead.
Clang.jl also generated lines like:
const __HWLOC_HAVE_ATTRIBUTE_UNUSED = GXX_ABOVE_3_4 || GCC_ABOVE_2_95
However the constants on the RHS are defined as integers, eg:
const GXX_ABOVE_3_4 = 0 const GCC_ABOVE_2_95 = 1
and so on. A quick fix was to replace || with |.
||
|
Thanks for the issue. Let's keep collecting those failure cases, so we can fix them in the next round of refactoring.
I am generating the bindings for Hwloc_jll, and I encountered a few edge cases that I thought you might like to know about -- all of these have straightforward workarounds, so this isn't urgent here.
hwloc.h
usesINT_MAX
:requiring the inclusion of something like:
hwloc.h
defines:which
Clang.jl
translated to:I replaced this line with:
instead.
Clang.jl
also generated lines like:However the constants on the RHS are defined as integers, eg:
and so on. A quick fix was to replace
||
with|
.