From 368f3446671c4a4cc158ebc2d9467dc8396547ef Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 29 Jul 2017 01:00:30 -0400 Subject: [PATCH] Fix define/include --- config.h | 4 ++-- crc-simd.cpp | 12 ++++++------ crc.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config.h b/config.h index d3ef4f5e..917801e8 100644 --- a/config.h +++ b/config.h @@ -433,7 +433,7 @@ NAMESPACE_END // ***************** IA32 CPU features ******************** -#if defined(CRYPTOPP_BOOL_X86) || defined(CRYPTOPP_BOOL_X32) || defined(CRYPTOPP_BOOL_X64) +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) // Apple Clang prior to 5.0 cannot handle SSE2 #if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) @@ -507,7 +507,7 @@ NAMESPACE_END // ***************** ARM CPU features ******************** -#if defined(CRYPTOPP_BOOL_ARM32) || defined(CRYPTOPP_BOOL_ARM64) +#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) // Requires ARMv7 and ACLE 1.0. Testing shows ARMv7 is really ARMv7a under most toolchains. #if !defined(CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) diff --git a/crc-simd.cpp b/crc-simd.cpp index deab4273..fa3d40c0 100644 --- a/crc-simd.cpp +++ b/crc-simd.cpp @@ -1,20 +1,20 @@ // crc-simd.cpp - written and placed in the public domain by // Jeffrey Walton, Uri Blumenthal and Marcel Raad. // -// The source file uses intrinsics to gain access to SSE4.2 and +// This source file uses intrinsics to gain access to SSE4.2 and // ARMv8a CRC-32 and CRC-32C instructions. A separate source file -// is needed because we need additional CXXFLAGS to enable the -// appropriate instructions sets. +// is needed because additional CXXFLAGS are required to enable +// the appropriate instructions sets in some build configurations. #include "pch.h" #include "config.h" #include "misc.h" -#if defined(CRYPTOPP_SSE42_AVAILABLE) +#if (CRYPTOPP_SSE42_AVAILABLE) # include "nmmintrin.h" #endif -#if defined(CRYPTOPP_ARMV8A_CRC32_AVAILABLE) && defined(__GNUC__) +#if (CRYPTOPP_ARMV8A_CRC32_AVAILABLE) && defined(__GNUC__) # include "arm_neon.h" # include "arm_acle.h" #endif @@ -47,7 +47,7 @@ void CRC32C_Update_ARMV8(const byte *s, size_t n, word32& c) } #endif -#if CRYPTOPP_SSE42_AVAILABLE +#if (CRYPTOPP_SSE42_AVAILABLE) void CRC32C_Update_SSE42(const byte *s, size_t n, word32& c) { for(; !IsAligned(s) && n > 0; s++, n--) diff --git a/crc.cpp b/crc.cpp index fa85dbba..7dee01c3 100644 --- a/crc.cpp +++ b/crc.cpp @@ -296,7 +296,7 @@ CRC32C::CRC32C() void CRC32C::Update(const byte *s, size_t n) { -#if CRYPTOPP_SSE42_AVAILABLE +#if (CRYPTOPP_SSE42_AVAILABLE) if (HasSSE4()) { CRC32C_Update_SSE42(s, n, m_crc);