From 0b67911199d3c563df42831a636c1d6ff6fce19e Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 9 Mar 2011 18:42:50 +0000 Subject: [PATCH] - vc++ compile fixes --- .../sources/platform/common/platform_common.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 956f4efb..7b969167 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -1101,7 +1101,12 @@ bool executeShellCommand(string cmd) { bool result = false; if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nAbout to run [%s]", cmd.c_str()); +#ifdef WIN32 + FILE *file = _popen(cmd.c_str(),"r"); +#else FILE *file = popen(cmd.c_str(),"r"); +#endif + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nfile = [%p]", file); if(file != NULL) { @@ -1111,8 +1116,12 @@ bool executeShellCommand(string cmd) { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf); } } - +#ifdef WIN32 + int cmdRet = _pclose(file); +#else int cmdRet = pclose(file); +#endif + /* Close pipe and print return value. */ if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nProcess returned %d", cmdRet); result = true;