From c3aedf480dd4e224165d9b8b5ed8735191eede6c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 19 Sep 2016 22:10:21 +0900 Subject: [PATCH] Fix -Wexpansion-to-defined warning with clang-3.9 The error message was: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html --- src/libssl_compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libssl_compat.h b/src/libssl_compat.h index fa8e6f65..0e03bfd7 100644 --- a/src/libssl_compat.h +++ b/src/libssl_compat.h @@ -37,7 +37,13 @@ #include +#if defined(LIBRESSL_VERSION_NUMBER) +#define LIBRESSL_IN_USE 1 +#else // !defined(LIBRESSL_VERSION_NUMBER) +#define LIBRESSL_IN_USE 0 +#endif // !defined(LIBRESSL_VERSION_NUMBER) + #define OPENSSL_101_API \ - (!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1010000fL) + (!LIBRESSL_IN_USE && OPENSSL_VERSION_NUMBER >= 0x1010000fL) #endif // LIBSSL_COMPAT_H