diff --git a/nel/include/nel/misc/stream.h b/nel/include/nel/misc/stream.h index 35b6c3f26..89db78a1c 100644 --- a/nel/include/nel/misc/stream.h +++ b/nel/include/nel/misc/stream.h @@ -300,13 +300,6 @@ public: virtual void serial(bool &b) ; #ifndef NL_OS_CYGWIN virtual void serial(char &b) ; -#endif -#ifdef NL_OS_WINDOWS - inline void serial(wchar_t &b) - { - nlctassert(sizeof(wchar_t) == sizeof(uint16)); - serial(reinterpret_cast(b)); - } #endif virtual void serial(std::string &b) ; virtual void serial(ucstring &b) ; diff --git a/nel/include/nel/misc/types_nl.h b/nel/include/nel/misc/types_nl.h index b8fe8270a..bac48c3d6 100644 --- a/nel/include/nel/misc/types_nl.h +++ b/nel/include/nel/misc/types_nl.h @@ -546,11 +546,7 @@ template<> struct hash * \typedef ucchar * An Unicode character (16 bits) */ -#if defined(NL_OS_WINDOWS) -typedef wchar_t ucchar; -#else typedef uint16 ucchar; -#endif #ifdef NL_CPP14 typedef char32_t u32char; diff --git a/nel/include/nel/misc/ucstring.h b/nel/include/nel/misc/ucstring.h index 28c83ce2f..5b7597f00 100644 --- a/nel/include/nel/misc/ucstring.h +++ b/nel/include/nel/misc/ucstring.h @@ -30,11 +30,7 @@ * An unicode string class (16 bits per character). * Add features to convert and assign \c ucstring to \c string and \c string to \c ucstring. */ -#if defined(NL_OS_WINDOWS) -typedef std::wstring ucstringbase; -#else typedef std::basic_string ucstringbase; -#endif class ucstring : public ucstringbase { diff --git a/nel/src/misc/system_utils.cpp b/nel/src/misc/system_utils.cpp index 42fe63fca..63eecbf0d 100644 --- a/nel/src/misc/system_utils.cpp +++ b/nel/src/misc/system_utils.cpp @@ -168,7 +168,7 @@ bool CSystemUtils::copyTextToClipboard(const ucstring &text) // allocates a buffer to copy text in global memory std::string textLocal; - if (!isUnicode) textLocal = NLMISC::wideToMbcs(text); + if (!isUnicode) textLocal = NLMISC::wideToMbcs((const wchar_t *)text.c_str(), text.size()); if (text.size() && !textLocal.size()) textLocal = text.toString(); HGLOBAL mem = GlobalAlloc(GHND | GMEM_DDESHARE, isUnicode ? ((text.size() + 1) * sizeof(wchar_t)) : textLocal.size()); @@ -232,7 +232,7 @@ bool CSystemUtils::pasteTextFromClipboard(ucstring &text) } else { - static_cast(text) = NLMISC::mbcsToWide((const char *)hLock); + reinterpret_cast(text) = NLMISC::mbcsToWide((const char *)hLock); if (!text.size() && ((const char *)hLock)[0]) text = (const char *)hLock; }