From 00b3b323de0843d83b7a87c8fe7c7375488438e2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Dec 2017 22:45:24 +0100 Subject: [PATCH] Define std-related symbols in configure when using C++11 too Even though we don't need to perform the checks for the availability of or headers when using C++11 because we can safely assume they're indeed available, we still need to define the corresponding symbols, as if the checks were performed, so that the code inside and outside the library could test them in any case, whether we're using C++11 or not. --- configure | 14 +++++++++++++- configure.in | 13 +++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 4b10f91843..552ae5d62e 100755 --- a/configure +++ b/configure @@ -19111,8 +19111,20 @@ if test "x$COMPAQCXX" = "xyes"; then CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit" fi -if test "$HAVE_CXX11" != "1" ; then +if test "$HAVE_CXX11" = "1" ; then +$as_echo "#define HAVE_STD_WSTRING 1" >>confdefs.h + +$as_echo "#define HAVE_STD_STRING_COMPARE 1" >>confdefs.h + +$as_echo "#define HAVE_STD_UNORDERED_MAP 1" >>confdefs.h + +$as_echo "#define HAVE_STD_UNORDERED_SET 1" >>confdefs.h + +$as_echo "#define HAVE_TYPE_TRAITS 1" >>confdefs.h + + +else ac_ext=cpp diff --git a/configure.in b/configure.in index 7b20dff46f..6da04e5510 100644 --- a/configure.in +++ b/configure.in @@ -1818,8 +1818,17 @@ if test "x$COMPAQCXX" = "xyes"; then fi dnl The checks below are for ancient compilers and are unnecessary when using -dnl C++11. -if test "$HAVE_CXX11" != "1" ; then +dnl C++11, but we still need to define the symbols that would have been defined +dnl by them if we did run them. +if test "$HAVE_CXX11" = "1" ; then + +AC_DEFINE(HAVE_STD_WSTRING) +AC_DEFINE(HAVE_STD_STRING_COMPARE) +AC_DEFINE(HAVE_STD_UNORDERED_MAP) +AC_DEFINE(HAVE_STD_UNORDERED_SET) +AC_DEFINE(HAVE_TYPE_TRAITS) + +else dnl Not using C++11, so we do need to run the checks. dnl check for iostream (as opposed to iostream.h) standard header WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))