From a587e5750379b57e0a1e2ea3d3398a67eed86d37 Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Fri, 1 Feb 2008 13:55:12 -0330 Subject: Fixed Windows compile error --- cpp/src/Slice/Preprocessor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cpp/src/Slice/Preprocessor.cpp') diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index eed134be39b..10047df7cb3 100755 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -157,8 +157,11 @@ Slice::Preprocessor::preprocess(bool keepComments) // we need to save handle to stdin so we can restore it // after mcpp has finished its processing. // +#ifdef _WIN32 +#else int stdin_save; stdin_save = dup(0); +#endif // // Call mcpp using memory buffer. @@ -170,10 +173,13 @@ Slice::Preprocessor::preprocess(bool keepComments) // // Restore stdin. // +#ifdef _WIN32 +#else fflush(stdin); ::close(0); dup2(stdin_save, 0); ::close(stdin_save); +#endif // // Write output to temporary file. Print errors to stderr. @@ -184,7 +190,7 @@ Slice::Preprocessor::preprocess(bool keepComments) _cppFile = ".preprocess." + IceUtil::generateUUID(); SignalHandler::addFile(_cppFile); #ifdef _WIN32 - _cppHandle = ::_fopen(_cppFile.c_str(), "w+"); + _cppHandle = ::_wfopen(IceUtil::stringToWstring(_cppFile).c_str(), IceUtil::stringToWstring("w+").c_str()); #else _cppHandle = ::fopen(_cppFile.c_str(), "w+"); #endif -- cgit v1.2.3