diff --git a/src/cond.c b/src/cond.c index 27d9ada93392..8bc1183b80b4 100644 --- a/src/cond.c +++ b/src/cond.c @@ -213,6 +213,8 @@ bool VersionCondition::isPredefined(const char *ident) "Alpha_HardFloat", "LittleEndian", "BigEndian", + "ELFv1", + "ELFv2", "D_Coverage", "D_Ddoc", "D_InlineAsm_X86", diff --git a/src/mars.c b/src/mars.c index a635bddaac4b..9c7debd00603 100644 --- a/src/mars.c +++ b/src/mars.c @@ -444,10 +444,12 @@ int tryMain(size_t argc, const char *argv[]) #elif TARGET_LINUX VersionCondition::addPredefinedGlobalIdent("Posix"); VersionCondition::addPredefinedGlobalIdent("linux"); + VersionCondition::addPredefinedGlobalIdent("ELFv1"); global.params.isLinux = true; #elif TARGET_OSX VersionCondition::addPredefinedGlobalIdent("Posix"); VersionCondition::addPredefinedGlobalIdent("OSX"); + VersionCondition::addPredefinedGlobalIdent("ELFv1"); global.params.isOSX = true; // For legacy compatibility @@ -455,14 +457,17 @@ int tryMain(size_t argc, const char *argv[]) #elif TARGET_FREEBSD VersionCondition::addPredefinedGlobalIdent("Posix"); VersionCondition::addPredefinedGlobalIdent("FreeBSD"); + VersionCondition::addPredefinedGlobalIdent("ELFv1"); global.params.isFreeBSD = true; #elif TARGET_OPENBSD VersionCondition::addPredefinedGlobalIdent("Posix"); VersionCondition::addPredefinedGlobalIdent("OpenBSD"); + VersionCondition::addPredefinedGlobalIdent("ELFv1"); global.params.isFreeBSD = true; #elif TARGET_SOLARIS VersionCondition::addPredefinedGlobalIdent("Posix"); VersionCondition::addPredefinedGlobalIdent("Solaris"); + VersionCondition::addPredefinedGlobalIdent("ELFv1"); global.params.isSolaris = true; #else #error "fix this"