From c54b0870a8376ab66c9f7c0b302959009dab9708 Mon Sep 17 00:00:00 2001 From: Scott Dial Date: Mon, 26 Sep 2011 19:33:28 -0400 Subject: [PATCH] Assiging the bswap_{16,32,64} macros to __builtin_bswap{16,32,64}. --- miner.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/miner.h b/miner.h index 52e4993f..5c996c70 100644 --- a/miner.h +++ b/miner.h @@ -81,7 +81,9 @@ void *alloca (size_t); #endif #if !defined(WIN32) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) -#define WANT_BUILTIN_BSWAP +#define bswap_16 __builtin_bswap16 +#define bswap_32 __builtin_bswap32 +#define bswap_64 __builtin_bswap64 #else #if HAVE_BYTESWAP_H #include @@ -99,7 +101,7 @@ void *alloca (size_t); #define bswap_32(value) \ (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ (uint32_t)bswap_16((uint16_t)((value) >> 16))) - + #define bswap_64(value) \ (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \ << 32) | \ @@ -244,11 +246,7 @@ extern void thr_info_cancel(struct thr_info *thr); static inline uint32_t swab32(uint32_t v) { -#ifdef WANT_BUILTIN_BSWAP - return __builtin_bswap32(v); -#else return bswap_32(v); -#endif } static inline void swap256(void *dest_p, const void *src_p)