diff options
author | Jose <jose@zeroc.com> | 2009-11-10 05:30:26 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-11-10 05:30:26 +0100 |
commit | 4247c9e2c2612394a5f4d63a65ba538f975906d4 (patch) | |
tree | 96d3308681d9b0684ce5dd763f5a5d415eaf09d7 /cpp/src/Slice/Preprocessor.cpp | |
parent | Win32 64 bits compilation error (diff) | |
download | ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.tar.bz2 ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.tar.xz ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.zip |
Fixed 3962 - Berkeley DB, problems with unicode paths.
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r-- | cpp/src/Slice/Preprocessor.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 03403498703..72f9226c449 100644 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -122,8 +122,8 @@ Slice::Preprocessor::normalizeIncludePath(const string& path) result.replace(pos, 2, "/"); } - if(result == "/" || (result.size() == 3 && isalpha(static_cast<unsigned char>(result[0])) && result[1] == ':' && - result[2] == '/')) + if(result == "/" || (result.size() == 3 && IceUtilInternal::isAlpha(result[0]) && result[1] == ':' && + result[2] == '/')) { return result; } @@ -205,9 +205,9 @@ Slice::Preprocessor::preprocess(bool keepComments) wchar_t* name = _wtempnam(NULL, L".preprocess"); if(name) { - _cppFile = wstring(name); + _cppFile = IceUtil::wstringToString(name); free(name); - _cppHandle = ::_wfopen(_cppFile.c_str(), L"w+"); + _cppHandle = IceUtilInternal::fopen(_cppFile, "w+"); } #else _cppHandle = tmpfile(); @@ -218,13 +218,8 @@ Slice::Preprocessor::preprocess(bool keepComments) // if(_cppHandle == 0) { -#ifdef _WIN32 - _cppFile = L".preprocess." + IceUtil::stringToWstring(IceUtil::generateUUID()); - _cppHandle = ::_wfopen(_cppFile.c_str(), L"w+"); -#else _cppFile = ".preprocess." + IceUtil::generateUUID(); - _cppHandle = ::fopen(_cppFile.c_str(), "w+"); -#endif + _cppHandle = IceUtilInternal::fopen(_cppFile, "w+"); } if(_cppHandle != 0) @@ -239,11 +234,7 @@ Slice::Preprocessor::preprocess(bool keepComments) { ostream& os = getErrorStream(); os << _path << ": error: could not open temporary file: "; -#ifdef _WIN32 - os << IceUtil::wstringToString(_cppFile); -#else os << _cppFile; -#endif os << endl; } } @@ -593,11 +584,7 @@ Slice::Preprocessor::close() if(_cppFile.size() != 0) { -#ifdef _WIN32 - _wunlink(_cppFile.c_str()); -#else - unlink(_cppFile.c_str()); -#endif + IceUtilInternal::unlink(_cppFile); } if(status != 0) |