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
All enums exposed in the api use either the default int or unsigned long for their underlying type. This is an issue for building ffi bindings, because the size of these types vary across platforms. In particular, sizeof(unsigned long) is 4 on windows, but 8 on linux. Based on your code, you expect these enums to have an exact width consistent across platforms, so it should be simple enough to declare all enums using uintN_t as their underlying type.
The text was updated successfully, but these errors were encountered:
Type ILP64 LP64 LLP64
char 8 8 8
short 16 16 16
int 64 32 32
long 64 64 32
long long 64 64 64
pointer 64 64 64
Thanks for the feedback. I'm debating the right solution here. I had originally used DWORD for flags to be consistent with Win32 standards, but over the years I've moved towards C++ standard types wherever possible. Since DWORD is a unsigned long I converted my usage to that so that it would still be the same as using DWORD including the way the types are mangled--there were some really sketchy client scenarios at work.
I don't know that maintaining the link compatibility of DWORD is still needed. I'll need to try some things.
@walbourn
I tried to recreate the Pull Request because the previous one couldn't be reopened.
Here is the link (just in case, I included the links and the request): #539
All enums exposed in the api use either the default
int
orunsigned long
for their underlying type. This is an issue for building ffi bindings, because the size of these types vary across platforms. In particular,sizeof(unsigned long)
is4
on windows, but8
on linux. Based on your code, you expect these enums to have an exact width consistent across platforms, so it should be simple enough to declare all enums usinguintN_t
as their underlying type.The text was updated successfully, but these errors were encountered: