From 0edb6348d20ec35a8ac65453239097078d947b7e Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Sun, 14 Dec 2014 14:45:43 -0500 Subject: [PATCH] Fix compile for some versions of mingw The bswap intrinsics are specific to the compiler, not the host platform. No functional change. Resolves #155 --- src/syzygy/tbcore.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/syzygy/tbcore.h b/src/syzygy/tbcore.h index e47acfc3..cdaf2aca 100644 --- a/src/syzygy/tbcore.h +++ b/src/syzygy/tbcore.h @@ -22,15 +22,17 @@ #define LOCK_INIT(x) pthread_mutex_init(&(x), NULL) #define LOCK(x) pthread_mutex_lock(&(x)) #define UNLOCK(x) pthread_mutex_unlock(&(x)) - -#define BSWAP32(v) __builtin_bswap32(v) -#define BSWAP64(v) __builtin_bswap64(v) #else #define LOCK_T HANDLE #define LOCK_INIT(x) do { x = CreateMutex(NULL, FALSE, NULL); } while (0) #define LOCK(x) WaitForSingleObject(x, INFINITE) #define UNLOCK(x) ReleaseMutex(x) +#endif +#ifndef _MSC_VER +#define BSWAP32(v) __builtin_bswap32(v) +#define BSWAP64(v) __builtin_bswap64(v) +#else #define BSWAP32(v) _byteswap_ulong(v) #define BSWAP64(v) _byteswap_uint64(v) #endif -- 2.39.2