From 62bf142f06590c799cf8b0af8e9b14a0baee2588 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 25 Aug 2011 11:38:12 +0100 Subject: [PATCH] Fix ProcessUtils compilation on Linux/Mac * Only compile the Windows command-line conversion function on Windows --- src/ProcessUtils.cpp | 6 +++++- src/ProcessUtils.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ProcessUtils.cpp b/src/ProcessUtils.cpp index 39ecdea..70af1f1 100644 --- a/src/ProcessUtils.cpp +++ b/src/ProcessUtils.cpp @@ -401,6 +401,8 @@ std::string ProcessUtils::currentProcessPath() return fileName; #endif } + +#ifdef PLATFORM_WINDOWS void ProcessUtils::convertWindowsCommandLine(LPCWSTR commandLine, int& argc, char**& argv) { argc = 0; @@ -437,4 +439,6 @@ void ProcessUtils::convertWindowsCommandLine(LPCWSTR commandLine, int& argc, cha } } LocalFree(argvUnicode); -} \ No newline at end of file +} +#endif + diff --git a/src/ProcessUtils.h b/src/ProcessUtils.h index 82035b7..3d47ad0 100644 --- a/src/ProcessUtils.h +++ b/src/ProcessUtils.h @@ -23,11 +23,13 @@ class ProcessUtils static bool waitForProcess(PLATFORM_PID pid); +#ifdef PLATFORM_WINDOWS /** Convert a unicode command line returned by GetCommandLineW() * to a standard (argc,argv) pair. The resulting argv array and each * element of argv must be freed using free() */ static void convertWindowsCommandLine(LPCWSTR commandLine, int& argc, char**& argv); +#endif private: static void runElevatedLinux(const std::string& executable,