1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-30 16:34:23 +00:00

Assiging the bswap_{16,32,64} macros to __builtin_bswap{16,32,64}.

This commit is contained in:
Scott Dial 2011-09-26 19:33:28 -04:00
parent 21c2bc469f
commit c54b0870a8

View File

@ -81,7 +81,9 @@ void *alloca (size_t);
#endif #endif
#if !defined(WIN32) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #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 #else
#if HAVE_BYTESWAP_H #if HAVE_BYTESWAP_H
#include <byteswap.h> #include <byteswap.h>
@ -244,11 +246,7 @@ extern void thr_info_cancel(struct thr_info *thr);
static inline uint32_t swab32(uint32_t v) static inline uint32_t swab32(uint32_t v)
{ {
#ifdef WANT_BUILTIN_BSWAP
return __builtin_bswap32(v);
#else
return bswap_32(v); return bswap_32(v);
#endif
} }
static inline void swap256(void *dest_p, const void *src_p) static inline void swap256(void *dest_p, const void *src_p)