[Issue 24412] No predefined version for 64bit ?!
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 26 04:46:02 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24412
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> ---
https://dlang.org/spec/version.html
Says:
```
D_LP64 Pointers are 64 bits (command line switch -m64). (Do not
confuse this with C's LP64 model)
D_X32 Pointers are 32 bits, but words are still 64 bits (x32 ABI)
(This can be defined in parallel to X86_64)
```
What the implementation actually does is:
```
if (tgt.isX86_64)
{
VersionCondition.addPredefinedGlobalIdent("D_InlineAsm_X86_64");
VersionCondition.addPredefinedGlobalIdent("X86_64");
}
else
{
VersionCondition.addPredefinedGlobalIdent("D_InlineAsm"); //legacy
VersionCondition.addPredefinedGlobalIdent("D_InlineAsm_X86");
VersionCondition.addPredefinedGlobalIdent("X86");
}
if (tgt.isLP64)
VersionCondition.addPredefinedGlobalIdent("D_LP64");
else if (tgt.isX86_64)
VersionCondition.addPredefinedGlobalIdent("X32");
```
Note how something simple turned into a monstrosity that nobody can figure out,
and the documentation is both wrong and incomplete. Sigh.
I suspect that the undocumented X32 is what Manu is looking for, but dmd never
generates it. Does gdc or ldc?
--
More information about the Digitalmars-d-bugs
mailing list