diff -r -c -N ../Ice-3.3.0-old/cpp/src/Slice/Preprocessor.cpp ./cpp/src/Slice/Preprocessor.cpp *** ../Ice-3.3.0-old/cpp/src/Slice/Preprocessor.cpp 2008-05-16 14:54:01.000000000 -0230 --- ./cpp/src/Slice/Preprocessor.cpp 2008-08-14 11:31:58.000000000 -0230 *************** *** 175,192 **** // char* buf = mcpp_get_mem_buffer(Out); - _cppFile = ".preprocess." + IceUtil::generateUUID(); - SignalHandler::addFile(_cppFile); #ifdef _WIN32 _cppHandle = ::_wfopen(IceUtil::stringToWstring(_cppFile).c_str(), IceUtil::stringToWstring("w+").c_str()); #else _cppHandle = ::fopen(_cppFile.c_str(), "w+"); #endif ! if(buf) { ! ::fwrite(buf, strlen(buf), 1, _cppHandle); } - ::rewind(_cppHandle); } // --- 175,206 ---- // char* buf = mcpp_get_mem_buffer(Out); #ifdef _WIN32 + TCHAR buffer[512]; + DWORD ret = GetTempPath(512, buffer); + if(ret > 512 || ret == 0) + { + fprintf(stderr, "GetTempPath failed (%d)\n", GetLastError()); + } + _cppFile = string(buffer) + "\\.preprocess." + IceUtil::generateUUID(); _cppHandle = ::_wfopen(IceUtil::stringToWstring(_cppFile).c_str(), IceUtil::stringToWstring("w+").c_str()); #else + _cppFile = "/tmp/.preprocess." + IceUtil::generateUUID(); _cppHandle = ::fopen(_cppFile.c_str(), "w+"); #endif ! if(_cppHandle != NULL) ! { ! SignalHandler::addFile(_cppFile); ! if(buf) ! { ! ::fwrite(buf, strlen(buf), 1, _cppHandle); ! } ! ::rewind(_cppHandle); ! } ! else { ! fprintf(stderr, "Could not open temporary file: %s\n", _cppFile.c_str()); } } //