Open Ryan-rsm-McKenzie opened 5 months ago
The joys of LP64 vs. LLP64.
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.
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.