diff options
author | Bernard Normier <bernard@zeroc.com> | 2003-12-01 18:12:00 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2003-12-01 18:12:00 +0000 |
commit | d3c97d3684313de23723d31a8bdb374acb5f977e (patch) | |
tree | 96480bd53b0dda1b198564e47d2087b27f74ec77 /cpp/src/IceUtil/Unicode.cpp | |
parent | Changed default for Freeze.Map.KeepIterators to 1 (diff) | |
download | ice-d3c97d3684313de23723d31a8bdb374acb5f977e.tar.bz2 ice-d3c97d3684313de23723d31a8bdb374acb5f977e.tar.xz ice-d3c97d3684313de23723d31a8bdb374acb5f977e.zip |
Added /Zc:wchar_t support to VC7.x builds
Diffstat (limited to 'cpp/src/IceUtil/Unicode.cpp')
-rw-r--r-- | cpp/src/IceUtil/Unicode.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/Unicode.cpp b/cpp/src/IceUtil/Unicode.cpp index c4ea2d36b16..2f553cd099a 100644 --- a/cpp/src/IceUtil/Unicode.cpp +++ b/cpp/src/IceUtil/Unicode.cpp @@ -158,3 +158,24 @@ IceUtil::stringToWstring(const string& str) return result; } + + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) +// +// See comments in IceUtil/Unicode.h +// +string +IceUtil::wstringToString(const basic_string<__wchar_t>& str) +{ + assert(sizeof(__wchar_t) == SIZEOF_WCHAR_T); + return wstringToString(*reinterpret_cast<const wstring*>(&str)); +} + +basic_string<__wchar_t> +IceUtil::stringToNativeWstring(const string& str) +{ + assert(sizeof(__wchar_t) == SIZEOF_WCHAR_T); + return *reinterpret_cast<basic_string<__wchar_t>* >(&stringToWstring(str)); +} + +#endif |