mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03:00
Predefine version D_X32 for 64-bit targets with 32-bit pointer size
This commit is contained in:
parent
a6cc5cde38
commit
ec5fd799b9
2 changed files with 3 additions and 0 deletions
|
@ -728,6 +728,8 @@ void registerPredefinedTargetVersions() {
|
|||
// Set versions for arch bitwidth
|
||||
if (gDataLayout->getPointerSizeInBits() == 64) {
|
||||
VersionCondition::addPredefinedGlobalIdent("D_LP64");
|
||||
} else if (triple.isArch64Bit()) {
|
||||
VersionCondition::addPredefinedGlobalIdent("D_X32");
|
||||
} else if (triple.isArch16Bit()) {
|
||||
VersionCondition::addPredefinedGlobalIdent("D_P16");
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ static assert(size_t.sizeof == 4);
|
|||
static assert(ptrdiff_t.sizeof == 4);
|
||||
|
||||
version (D_LP64) static assert(0);
|
||||
version (D_X32) { /* expected */ } else static assert(0);
|
||||
|
||||
bool equals(string lhs, string rhs)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue