Mercurial > projects > ldc
changeset 1531:7120a74e9ae2
Remove duplicated code
This was implemented for windows in llvm r73379
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Sat, 11 Jul 2009 13:58:23 +0200 |
parents | 05c235309d6f |
children | c88b16d4a13c |
files | gen/configfile.cpp |
diffstat | 1 files changed, 0 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/configfile.cpp Sun Jul 12 16:15:21 2009 +0200 +++ b/gen/configfile.cpp Sat Jul 11 13:58:23 2009 +0200 @@ -11,11 +11,6 @@ #include "mars.h" -#if _WIN32 -#include <windows.h> -#undef GetCurrentDirectory -#endif - namespace sys = llvm::sys; ConfigFile::ConfigFile() @@ -28,17 +23,6 @@ delete cfg; } -#if _WIN32 -sys::Path ConfigGetExePath(sys::Path p) -{ - char buf[MAX_PATH]; - GetModuleFileName(NULL, buf, MAX_PATH); - p = buf; - p.eraseComponent(); - return p; -} -#endif - bool ConfigFile::locate(sys::Path& p, const char* argv0, void* mainAddr, const char* filename) { @@ -89,12 +73,8 @@ #endif // 7) try next to the executable -#if _WIN32 - p = ConfigGetExePath(p); -#else p = sys::Path::GetMainExecutable(argv0, mainAddr); p.eraseComponent(); -#endif p.appendComponent(filename); if (p.exists()) return true; @@ -138,14 +118,7 @@ { std::string binpathkey = "%%ldcbinarypath%%"; - #if _WIN32 - sys::Path p; - p = ConfigGetExePath(p); - std::string binpath = p.toString(); - #else std::string binpath = sys::Path::GetMainExecutable(argv0, mainAddr).getDirname(); - #endif - libconfig::Setting& arr = cfg->lookup("default.switches"); int len = arr.getLength();