mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 05:43:14 +01:00
Add Android version identifier
This commit is contained in:
@@ -570,6 +570,12 @@ static void registerPredefinedTargetVersions() {
|
||||
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");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case llvm::Triple::Haiku:
|
||||
VersionCondition::addPredefinedGlobalIdent("Haiku");
|
||||
@@ -609,8 +615,19 @@ static void registerPredefinedTargetVersions() {
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
error("target '%s' is not yet supported", global.params.targetTriple.str().c_str());
|
||||
fatal();
|
||||
switch (global.params.targetTriple.getEnvironment())
|
||||
{
|
||||
#if LDC_LLVM_VER >= 302
|
||||
case llvm::Triple::Android:
|
||||
VersionCondition::addPredefinedGlobalIdent("Android");
|
||||
VersionCondition::addPredefinedGlobalIdent("linux");
|
||||
VersionCondition::addPredefinedGlobalIdent("Posix");
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
error("target '%s' is not yet supported", global.params.targetTriple.str().c_str());
|
||||
fatal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user