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;
#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);
}
}
#endif

View File

@ -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,