mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 13:53:14 +01:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user