From 917bd7b90118117a846429898239a286b34b78d2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 11 Jul 2009 13:58:23 +0200 Subject: [PATCH] Remove duplicated code This was implemented for windows in llvm r73379 --- gen/configfile.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/gen/configfile.cpp b/gen/configfile.cpp index 70bab1a6..d9835222 100644 --- a/gen/configfile.cpp +++ b/gen/configfile.cpp @@ -11,11 +11,6 @@ #include "mars.h" -#if _WIN32 -#include -#undef GetCurrentDirectory -#endif - namespace sys = llvm::sys; ConfigFile::ConfigFile() @@ -28,17 +23,6 @@ ConfigFile::~ConfigFile() 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 @@ bool ConfigFile::locate(sys::Path& p, const char* argv0, void* mainAddr, const c #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 @@ bool ConfigFile::read(const char* argv0, void* mainAddr, const char* filename) { 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();