Fix ProcessUtils compilation on Linux/Mac

* Only compile the Windows command-line conversion function on Windows
This commit is contained in:
Robert Knight 2011-08-25 11:38:12 +01:00
parent d1848ff35a
commit 62bf142f06
2 changed files with 7 additions and 1 deletions

View file

@ -401,6 +401,8 @@ std::string ProcessUtils::currentProcessPath()
return fileName; return fileName;
#endif #endif
} }
#ifdef PLATFORM_WINDOWS
void ProcessUtils::convertWindowsCommandLine(LPCWSTR commandLine, int& argc, char**& argv) void ProcessUtils::convertWindowsCommandLine(LPCWSTR commandLine, int& argc, char**& argv)
{ {
argc = 0; argc = 0;
@ -438,3 +440,5 @@ void ProcessUtils::convertWindowsCommandLine(LPCWSTR commandLine, int& argc, cha
} }
LocalFree(argvUnicode); LocalFree(argvUnicode);
} }
#endif

View file

@ -23,11 +23,13 @@ class ProcessUtils
static bool waitForProcess(PLATFORM_PID pid); static bool waitForProcess(PLATFORM_PID pid);
#ifdef PLATFORM_WINDOWS
/** Convert a unicode command line returned by GetCommandLineW() /** Convert a unicode command line returned by GetCommandLineW()
* to a standard (argc,argv) pair. The resulting argv array and each * to a standard (argc,argv) pair. The resulting argv array and each
* element of argv must be freed using free() * element of argv must be freed using free()
*/ */
static void convertWindowsCommandLine(LPCWSTR commandLine, int& argc, char**& argv); static void convertWindowsCommandLine(LPCWSTR commandLine, int& argc, char**& argv);
#endif
private: private:
static void runElevatedLinux(const std::string& executable, static void runElevatedLinux(const std::string& executable,