You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that getting the correct integer type from #define is very difficult, however using UINT64_C should clarify to bindgen that it's a 64-bit integer. Currently the macro parser fails on UINT64_C and the Clang macro fallback is needed, but that still generates a 32-bit integer.
Header:
#include<stdint.h>#defineSOMETHING UINT64_C(1)
Without --clang-macro-fallback:
bindgen --allowlist-item SOMETHING header.h
Output:
/* automatically generated by rust-bindgen 0.71.1 */
Hi @Kriskras99, this has to do with the type of integers reported by Clang when evaluating macro bodies. It does not report a size so it ends up defaulting to a 32-bit width integer. Now theoretically we could make all of these integers 64-bit, but until Clang reports the correct size in this context, we can't really take a more fine-grained approach. We rely on Clang to report that information elsewhere in bindgen.
I understand that getting the correct integer type from
#define
is very difficult, however using UINT64_C should clarify to bindgen that it's a 64-bit integer. Currently the macro parser fails on UINT64_C and the Clang macro fallback is needed, but that still generates a 32-bit integer.Header:
Without
--clang-macro-fallback
:Output:
With
--clang-macro-fallback
:Output:
The text was updated successfully, but these errors were encountered: