diff --git a/dmd/mars.c b/dmd/mars.c index 285412be..3313309b 100644 --- a/dmd/mars.c +++ b/dmd/mars.c @@ -66,9 +66,7 @@ Global::Global() bc_ext = "bc"; s_ext = "s"; obj_ext = "o"; -#if _WIN32 obj_ext_alt = "obj"; -#endif copyright = "Copyright (c) 1999-2012 by Digital Mars and Tomas Lindquist Olsen"; written = "written by Walter Bright and Tomas Lindquist Olsen"; diff --git a/dmd/mars.h b/dmd/mars.h index 4afc4eb0..8ca5f002 100644 --- a/dmd/mars.h +++ b/dmd/mars.h @@ -321,12 +321,10 @@ struct Global const char *mars_ext; const char *sym_ext; const char *obj_ext; -#if _WIN32 - char *obj_ext_alt; -#endif - char *ll_ext; - char *bc_ext; - char *s_ext; + const char *obj_ext_alt; + const char *ll_ext; + const char *bc_ext; + const char *s_ext; const char *lib_ext; const char *dll_ext; const char *doc_ext; // for Ddoc generated files diff --git a/dmd/module.c b/dmd/module.c index f8b12287..248cdc75 100644 --- a/dmd/module.c +++ b/dmd/module.c @@ -247,7 +247,7 @@ void Module::buildTargetFiles(bool singleObj) else if (global.params.output_s) objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.s_ext); else - objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.obj_ext); + objfile = Module::buildFilePath(global.params.objname, global.params.objdir, global.params.os == OSWindows ? global.obj_ext_alt : global.obj_ext); } if(doDocComment && !docfile) docfile = Module::buildFilePath(global.params.docname, global.params.docdir, global.doc_ext);