Only define version Android if compiling for this environment.

Android is a variant of Linux. In order to simplify the version coding,
only version Android is defined (version linux and version Posix are not).
This commit is contained in:
Kai Nacke
2013-12-08 15:29:10 +01:00
parent 0628a1f9f3
commit a2d7c9f3ed

View File

@@ -568,14 +568,17 @@ static void registerPredefinedTargetVersions() {
VersionCondition::addPredefinedGlobalIdent("Cygwin");
break;
case llvm::Triple::Linux:
VersionCondition::addPredefinedGlobalIdent("linux");
VersionCondition::addPredefinedGlobalIdent("Posix");
#if LDC_LLVM_VER >= 302
if (global.params.targetTriple.getEnvironment() == llvm::Triple::Android)
{
VersionCondition::addPredefinedGlobalIdent("Android");
}
else
#endif
{
VersionCondition::addPredefinedGlobalIdent("linux");
VersionCondition::addPredefinedGlobalIdent("Posix");
}
break;
case llvm::Triple::Haiku:
VersionCondition::addPredefinedGlobalIdent("Haiku");
@@ -620,8 +623,6 @@ static void registerPredefinedTargetVersions() {
#if LDC_LLVM_VER >= 302
case llvm::Triple::Android:
VersionCondition::addPredefinedGlobalIdent("Android");
VersionCondition::addPredefinedGlobalIdent("linux");
VersionCondition::addPredefinedGlobalIdent("Posix");
break;
#endif
default: