Differentiate between Win32 and MinGW.

Removes also serach for OS name windows because this is unsupported by LLVM.
This commit is contained in:
kai
2012-07-20 06:48:29 +02:00
parent 55366bc319
commit b71429fc2a

View File

@@ -469,7 +469,7 @@ LDC_TARGETS
}
else
{
global.params.targetTriple = mTargetTriple.c_str();
global.params.targetTriple = llvm::Triple::normalize(mTargetTriple).c_str();
}
std::string triple = global.params.targetTriple;
@@ -606,8 +606,17 @@ LDC_TARGETS
size_t npos = std::string::npos;
// windows
// FIXME: win64
if (triple.find("windows") != npos || triple.find("win32") != npos || triple.find("mingw") != npos)
if (triple.find("win32") != npos)
{
global.params.os = OSWindows;
VersionCondition::addPredefinedGlobalIdent("Windows");
VersionCondition::addPredefinedGlobalIdent("Win32");
if (global.params.is64bit) {
VersionCondition::addPredefinedGlobalIdent("Win64");
}
}
// FIXME: mingw
else if (triple.find("mingw") != npos)
{
global.params.os = OSWindows;
VersionCondition::addPredefinedGlobalIdent("Windows");