From 042a2659f679304980a6ced85c3e59834a1b68c4 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 14 Nov 2016 07:45:23 +0100 Subject: [PATCH] Disable Codecvt for now, libstdc++ is problematic. Need to research which libstdc++ versions implement codecvt. --- simgear/misc/strutils.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/simgear/misc/strutils.cxx b/simgear/misc/strutils.cxx index 9fbcaf76..6865e6a8 100644 --- a/simgear/misc/strutils.cxx +++ b/simgear/misc/strutils.cxx @@ -26,7 +26,10 @@ #include #include // strerror_r() and strerror_s() #include -#include // new in C++11 + +#if defined(HAVE_CPP11_CODECVT) + #include // new in C++11 +#endif #include "strutils.hxx" @@ -401,9 +404,11 @@ std::wstring convertUtf8ToWString(const std::string& a) { #ifdef SG_WINDOWS return convertMultiByteToWString(CP_UTF8, a); -#else +#elif defined(HAVE_CPP11_CODECVT) std::wstring_convert, wchar_t> ucs2conv; return ucs2conv.from_bytes(a); +#else + return std::wstring(); #endif } @@ -411,9 +416,11 @@ std::string convertWStringToUtf8(const std::wstring& w) { #ifdef SG_WINDOWS return convertWStringToMultiByte(CP_UTF8, w); -#else +#elif defined(HAVE_CPP11_CODECVT) std::wstring_convert, wchar_t> ucs2conv; return ucs2conv.to_bytes(w); +#else + return std::string(); #endif }