From 2642299d772a3b88264d5fb05086817d0742ced7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 29 Oct 2017 13:20:39 +0000 Subject: [PATCH] We require C++11 now, simplify this code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures wstring to std::string conversion is always available, needed for some HID work I’m doing on a branch,. --- simgear/misc/strutils.cxx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/simgear/misc/strutils.cxx b/simgear/misc/strutils.cxx index f45e0ac8..aee6a49c 100644 --- a/simgear/misc/strutils.cxx +++ b/simgear/misc/strutils.cxx @@ -29,11 +29,8 @@ #include // strerror_r() and strerror_s() #include #include - -#if defined(HAVE_CPP11_CODECVT) - #include // new in C++11 -#endif - +#include + #include "strutils.hxx" #include @@ -656,26 +653,14 @@ static std::string convertWStringToMultiByte(DWORD encoding, const std::wstring& std::wstring convertUtf8ToWString(const std::string& a) { -#ifdef SG_WINDOWS - return convertMultiByteToWString(CP_UTF8, a); -#elif defined(HAVE_CPP11_CODECVT) std::wstring_convert, wchar_t> ucs2conv; return ucs2conv.from_bytes(a); -#else - return std::wstring(); -#endif } std::string convertWStringToUtf8(const std::wstring& w) { -#ifdef SG_WINDOWS - return convertWStringToMultiByte(CP_UTF8, w); -#elif defined(HAVE_CPP11_CODECVT) std::wstring_convert, wchar_t> ucs2conv; return ucs2conv.to_bytes(w); -#else - return std::string(); -#endif } std::string convertWindowsLocal8BitToUtf8(const std::string& a)