Bug 17890 – cpp_long is not declared for Posix 64bit
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2017-10-10T14:46:38Z
Last change time
2019-04-12T15:06:36Z
Keywords
C++
Assigned to
No Owner
Creator
Илья Ярошенко
Comments
Comment #0 by ilyayaroshenko — 2017-10-10T14:46:38Z
...
BTW, why c_long is always 32 bit for windows?
Comment #1 by dfj1esp02 — 2017-10-10T17:25:38Z
(In reply to Илья Ярошенко from comment #0)
> BTW, why c_long is always 32 bit for windows?
I suppose for compatibility with code written for 32-bit architecture, though long was 32-bit in 16-bit mode too.
(In reply to Илья Ярошенко from comment #0)
> ...
> BTW, why c_long is always 32 bit for windows?
Because `long` in 64 bit VC++ is 32 bits.
Comment #4 by issues.dlang — 2018-04-10T05:32:02Z
It's issues like that which make it so that I avoid long like the plague in C/C++. Personally, I use int if I don't care about the size, and one of the (u)int*_t types if I do, and I'm very glad that D mostly doesn't have the same problem where the size of types varies from system to system (though we're kind of stuck with regards to stuff like size_t due to how important it is that it interact properly with the pointer size on the machine).