From 079541687176913249fbd4a51ba366ed68f722b5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 16 Dec 2014 13:49:59 +0000 Subject: [PATCH] Fix building with -std=gnu++11 -stdlib=libstdc++ under OS X. Take into account the possibility of using C++11 compiler with non-C++11 standard library as this may happen when targeting OS X < 10.7, in which case C++11 libc++ can't be used. Closes #16730. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/wx/string.h b/include/wx/string.h index d4c054e71d..d6eb81baa1 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -3919,7 +3919,12 @@ wxDEFINE_ALL_COMPARISONS(const char *, const wxCStrData&, wxCMP_CHAR_CSTRDATA) // Implement hashing using C++11 std::hash<>. // ---------------------------------------------------------------------------- -#if __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(10) +// Check for both compiler and standard library support for C++11: normally the +// former implies the latter but under Mac OS X < 10.7 C++11 compiler can (and +// even has to be) used with non-C++11 standard library, so explicitly exclude +// this case. +#if (__cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(10)) \ + && ( (!defined __GLIBCXX__) || (__GLIBCXX__ > 20070719) ) // Don't do this if ToStdWstring() is not available. We could work around it // but, presumably, if using std::wstring is undesirable, then so is using