From 318d53f6f999a1c678aa07d7fe0ae7720da9be1d Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 3 Dec 2018 04:18:41 -0500 Subject: [PATCH] Avoid use of NDEBUG in source files Posix NDEBUG causes our test script to fail the Posix Assert test --- chacha_avx.cpp | 8 +++++--- rijndael.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/chacha_avx.cpp b/chacha_avx.cpp index 087c7a1e..f9565304 100644 --- a/chacha_avx.cpp +++ b/chacha_avx.cpp @@ -42,9 +42,11 @@ extern const char CHACHA_AVX_FNAME[] = __FILE__; // https://github.com/weidai11/cryptopp/issues/735. The // 649 issue affects AES but it is the same here. The 735 // issue is ChaCha AVX2 cut-in where it surfaced again. -#if (_MSC_VER >= 1910) && defined(NDEBUG) -# pragma optimize("", off) -# pragma optimize("ts", on) +#if (_MSC_VER >= 1910) +# ifndef CRYPTOPP_DEBUG +# pragma optimize("", off) +# pragma optimize("ts", on) +# endif #endif ANONYMOUS_NAMESPACE_BEGIN diff --git a/rijndael.cpp b/rijndael.cpp index b314733a..4793672a 100644 --- a/rijndael.cpp +++ b/rijndael.cpp @@ -91,9 +91,11 @@ being unloaded from L1 cache, until that round is finished. // VS2017 and global optimization bug. TODO, figure out when // we can re-enable full optimizations for VS2017. Also see // https://github.com/weidai11/cryptopp/issues/649 -#if (_MSC_VER >= 1910) && defined(NDEBUG) -# pragma optimize("", off) -# pragma optimize("ts", on) +#if (_MSC_VER >= 1910) +# ifndef CRYPTOPP_DEBUG +# pragma optimize("", off) +# pragma optimize("ts", on) +# endif #endif NAMESPACE_BEGIN(CryptoPP)