diff options
author | simon <[email protected]> | 2015-05-31 19:54:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-05-31 19:54:54 +0000 |
commit | c1d4458aa3c0af01a77a58997f8fdf8648d7ddef (patch) | |
tree | 303bb2f4e8cc5404427757fba1c35abe7bc257a3 /src | |
parent | adb77e960969d0636349db251c2035689457d224 (diff) |
Avoid 0-defining BOTAN_USE_GCC_INLINE_ASM
GH #103
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/buildh.in | 4 | ||||
-rw-r--r-- | src/lib/entropy/hres_timer/hres_timer.cpp | 2 | ||||
-rw-r--r-- | src/lib/entropy/rdrand/rdrand.cpp | 2 | ||||
-rw-r--r-- | src/lib/utils/bswap.h | 6 | ||||
-rw-r--r-- | src/lib/utils/cpuid.cpp | 2 |
5 files changed, 6 insertions, 10 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in index 36b5f3959..c83e3fcd1 100644 --- a/src/build-data/buildh.in +++ b/src/build-data/buildh.in @@ -79,10 +79,6 @@ #define BOTAN_USE_GCC_INLINE_ASM 1 #endif -#if !defined(BOTAN_USE_GCC_INLINE_ASM) - #define BOTAN_USE_GCC_INLINE_ASM 0 -#endif - #ifdef __GNUC__ #define BOTAN_GCC_VERSION \ (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__) diff --git a/src/lib/entropy/hres_timer/hres_timer.cpp b/src/lib/entropy/hres_timer/hres_timer.cpp index f86638ce0..6efa3b188 100644 --- a/src/lib/entropy/hres_timer/hres_timer.cpp +++ b/src/lib/entropy/hres_timer/hres_timer.cpp @@ -75,7 +75,7 @@ void High_Resolution_Timestamp::poll(Entropy_Accumulator& accum) #endif -#if BOTAN_USE_GCC_INLINE_ASM +#if defined(BOTAN_USE_GCC_INLINE_ASM) u64bit rtc = 0; diff --git a/src/lib/entropy/rdrand/rdrand.cpp b/src/lib/entropy/rdrand/rdrand.cpp index 3ae924cde..74876e203 100644 --- a/src/lib/entropy/rdrand/rdrand.cpp +++ b/src/lib/entropy/rdrand/rdrand.cpp @@ -38,7 +38,7 @@ void Intel_Rdrand::poll(Entropy_Accumulator& accum) { unsigned int r = 0; -#if BOTAN_USE_GCC_INLINE_ASM +#if defined(BOTAN_USE_GCC_INLINE_ASM) int cf = 0; // Encoding of rdrand %eax diff --git a/src/lib/utils/bswap.h b/src/lib/utils/bswap.h index 54f58a01d..6773b196d 100644 --- a/src/lib/utils/bswap.h +++ b/src/lib/utils/bswap.h @@ -41,13 +41,13 @@ inline u32bit reverse_bytes(u32bit val) */ return __builtin_bswap32(val); -#elif BOTAN_USE_GCC_INLINE_ASM && defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) +#elif defined(BOTAN_USE_GCC_INLINE_ASM) && defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) // GCC-style inline assembly for x86 or x86-64 asm("bswapl %0" : "=r" (val) : "0" (val)); return val; -#elif BOTAN_USE_GCC_INLINE_ASM && defined(BOTAN_TARGET_CPU_IS_ARM_FAMILY) +#elif defined(BOTAN_USE_GCC_INLINE_ASM) && defined(BOTAN_TARGET_CPU_IS_ARM_FAMILY) asm ("eor r3, %1, %1, ror #16\n\t" "bic r3, r3, #0x00FF0000\n\t" @@ -84,7 +84,7 @@ inline u64bit reverse_bytes(u64bit val) // GCC intrinsic added in 4.3, works for a number of CPUs return __builtin_bswap64(val); -#elif BOTAN_USE_GCC_INLINE_ASM && defined(BOTAN_TARGET_ARCH_IS_X86_64) +#elif defined(BOTAN_USE_GCC_INLINE_ASM) && defined(BOTAN_TARGET_ARCH_IS_X86_64) // GCC-style inline assembly for x86-64 asm("bswapq %0" : "=r" (val) : "0" (val)); return val; diff --git a/src/lib/utils/cpuid.cpp b/src/lib/utils/cpuid.cpp index 9dd2297e4..cdb986396 100644 --- a/src/lib/utils/cpuid.cpp +++ b/src/lib/utils/cpuid.cpp @@ -41,7 +41,7 @@ #define X86_CPUID(type, out) do { __cpuid(out, type); } while(0) #define X86_CPUID_SUBLEVEL(type, level, out) do { __cpuidex((int*)out, type, level); } while(0) -#elif defined(BOTAN_TARGET_ARCH_IS_X86_64) && BOTAN_USE_GCC_INLINE_ASM +#elif defined(BOTAN_TARGET_ARCH_IS_X86_64) && defined(BOTAN_USE_GCC_INLINE_ASM) #define X86_CPUID(type, out) \ asm("cpuid\n\t" : "=a" (out[0]), "=b" (out[1]), "=c" (out[2]), "=d" (out[3]) \ |