From 67bcdaed9abb442c72ab214d23e8e8e04739e445 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 31 Aug 2017 06:29:35 -0400 Subject: [PATCH] Fix compile under AIX 7.1 --- config.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 4f41ba5f..753e9add 100644 --- a/config.h +++ b/config.h @@ -809,7 +809,7 @@ NAMESPACE_END // ************** Instrumentation *************** -// GCC does not support; see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78204 +// GCC does not support; see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=78204 #if (CRYPTOPP_LLVM_CLANG_VERSION >= 30700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) # define CRYPTOPP_NO_SANITIZE(x) __attribute__((no_sanitize(x))) #else @@ -982,10 +982,20 @@ NAMESPACE_END #endif // nullptr_t compilers // TODO: Emplacement, R-values and Move semantics -// Needed because we are catching warnings with GCC and MSC #endif // CRYPTOPP_CXX11 +// Hack ahead. New GCC compilers like GCC 6 on AIX 7.0 or earlier don't have the +// synchronization gear. However, Wakely's test used for Apple does not work +// on the GCC/AIX combination. Another twist is we need other stuff from C++11, +// like no-except destructors. Dumping preprocessors shows the following may +// apply: http://stackoverflow.com/q/14191566/608639. +#if defined(_AIX) && defined(__GNUC__) +# if !defined(_GLIBCXX_HAS_GTHREADS) +# undef CRYPTOPP_CXX11_SYNCHRONIZATION +# endif +#endif + #if defined(CRYPTOPP_CXX11_NOEXCEPT) # define CRYPTOPP_THROW noexcept(false) # define CRYPTOPP_NO_THROW noexcept(true)