diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceUtil/UUID.cpp | 20 | ||||
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 4 |
2 files changed, 16 insertions, 8 deletions
diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/IceUtil/UUID.cpp index e3794c4d225..4c962dcd047 100644 --- a/cpp/src/IceUtil/UUID.cpp +++ b/cpp/src/IceUtil/UUID.cpp @@ -13,6 +13,7 @@ // ********************************************************************** #include <IceUtil/UUID.h> +#include <IceUtil/Unicode.h> #ifdef _WIN32 # include <rpc.h> @@ -32,16 +33,23 @@ IceUtil::generateUUID() UUID uuid; UuidCreate(&uuid); -
-#if _MSC_VER == 1200
- unsigned char* str;
+ +#if _MSC_VER > 1200 + wchar_t* str; #else - unsigned short* str; // Type has changed for some reason in VC++ 2002 (but doc still
-#endif // says it's unsigned char *...)
+ unsigned char* str; +#endif UuidToString(&uuid, &str); - string result(reinterpret_cast<char*>(str)); + string result; + +#if _MSC_VER > 1200 + result = wstringToString(wstring(str)); +#else + result = reinterpret_cast<char*>(str); +#endif + RpcStringFree(&str); return result; diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 5655da7e421..6d4ff64d2f6 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -3516,7 +3516,7 @@ Slice::Unit::setComment(const string& comment) string Slice::Unit::currentComment() { - string comment; + string comment = ""; comment.swap(_currentComment); return comment; } @@ -3600,7 +3600,7 @@ Slice::Unit::scanPosition(const char* s) { --_currentIncludeLevel; } - _currentComment.erase(); + _currentComment = ""; } else { |