From 5ad7bbd0c78d06b66b43503c6f173299a8d5fd47 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 17 Jul 2016 20:20:36 -0400 Subject: [PATCH] Guard CRYPTOPP_CXX11 for STLport On Android, the compiler will define __cplusplus=201103L when using -std=c++11 even with STLport. STLport appears to be abandoned sometime around 2008. --- config.h | 4 +++- config.recommend | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 098fe39b..6059777d 100644 --- a/config.h +++ b/config.h @@ -405,6 +405,8 @@ NAMESPACE_END # pragma GCC diagnostic ignored "-Wunused-function" #endif +// You may need to force include a C++ header on Android when using STLPort to ensure +// _STLPORT_VERSION is defined: CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -include iosfwd" // TODO: Figure out C++17 and lack of std::uncaught_exception #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT))) #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION @@ -756,7 +758,7 @@ NAMESPACE_END // Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler // GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html // Clang and C++11 language features, http://clang.llvm.org/cxx_status.html -#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) +#if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION) # define CRYPTOPP_CXX11 1 #endif diff --git a/config.recommend b/config.recommend index 8c67202e..1ff4e7ea 100644 --- a/config.recommend +++ b/config.recommend @@ -756,7 +756,7 @@ NAMESPACE_END // Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler // GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html // Clang and C++11 language features, http://clang.llvm.org/cxx_status.html -#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L) +#if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION) # define CRYPTOPP_CXX11 1 #endif