mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-25 13:19:01 +02:00
Removed redundant global.params.os field.
I hope I have untangled the checks for "native" Windows (Triple::Win32) vs. Windows/MinGW/Cygwin (Triple::isOSWindows) correctly. MinGW needs some default libraries as well, has to be fixed later.
This commit is contained in:
15
dmd2/mars.h
15
dmd2/mars.h
@@ -154,17 +154,6 @@ enum OUTPUTFLAG
|
||||
OUTPUTFLAGset // for -output
|
||||
};
|
||||
|
||||
enum OS
|
||||
{
|
||||
OSinvalid = llvm::Triple::UnknownOS,
|
||||
OSLinux = llvm::Triple::Linux,
|
||||
OSHaiku = llvm::Triple::Haiku,
|
||||
OSWindows = llvm::Triple::Win32,
|
||||
OSMacOSX = llvm::Triple::MacOSX,
|
||||
OSFreeBSD = llvm::Triple::FreeBSD,
|
||||
OSSolaris = llvm::Triple::Solaris,
|
||||
};
|
||||
|
||||
typedef unsigned char ubyte;
|
||||
#endif
|
||||
|
||||
@@ -190,9 +179,7 @@ struct Param
|
||||
#endif
|
||||
char map; // generate linker .map file
|
||||
bool is64bit; // generate 64 bit code
|
||||
#if IN_LLVM
|
||||
OS os;
|
||||
#else
|
||||
#if !IN_LLVM
|
||||
char isLinux; // generate code for linux
|
||||
char isOSX; // generate code for Mac OSX
|
||||
char isWindows; // generate code for Windows
|
||||
|
||||
@@ -357,7 +357,8 @@ void Module::buildTargetFiles(bool singleObj)
|
||||
if(!objfile)
|
||||
{
|
||||
if (global.params.output_o)
|
||||
objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.params.os == OSWindows ? global.obj_ext_alt : global.obj_ext);
|
||||
objfile = Module::buildFilePath(global.params.objname, global.params.objdir,
|
||||
global.params.targetTriple.isOSWindows() ? global.obj_ext_alt : global.obj_ext);
|
||||
else if (global.params.output_bc)
|
||||
objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.bc_ext);
|
||||
else if (global.params.output_ll)
|
||||
|
||||
13
dmd2/parse.c
13
dmd2/parse.c
@@ -980,11 +980,18 @@ enum LINK Parser::parseLinkage()
|
||||
}
|
||||
else if (id == Id::System)
|
||||
{
|
||||
// LDC we configure target at runtime
|
||||
if (global.params.os == OSWindows)
|
||||
#if IN_LLVM
|
||||
if (global.params.targetTriple.isOSWindows())
|
||||
link = LINKwindows;
|
||||
else
|
||||
link = LINKc;
|
||||
#else
|
||||
#if _WIN32
|
||||
link = LINKwindows;
|
||||
else
|
||||
#else
|
||||
link = LINKc;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -44,9 +44,9 @@ int os_critsecsize()
|
||||
// Return sizeof(RTL_CRITICAL_SECTION)
|
||||
return global.params.is64bit ? 40 : 24;
|
||||
#else
|
||||
if (global.params.os == OSWindows)
|
||||
if (global.params.targetTriple.isOSWindows())
|
||||
return global.params.is64bit ? 40 : 24;
|
||||
else if (global.params.os == OSFreeBSD)
|
||||
else if (global.params.targetTriple.getOS() == llvm::Triple::FreeBSD)
|
||||
return sizeof(size_t);
|
||||
else
|
||||
return sizeof(pthread_mutex_t);
|
||||
|
||||
Reference in New Issue
Block a user