mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Fix compile for some versions of mingw
The bswap intrinsics are specific to the compiler, not the host platform. No functional change. Resolves #155
This commit is contained in:
parent
14cf27e6f6
commit
0edb6348d2
1 changed files with 5 additions and 3 deletions
|
@ -22,15 +22,17 @@
|
||||||
#define LOCK_INIT(x) pthread_mutex_init(&(x), NULL)
|
#define LOCK_INIT(x) pthread_mutex_init(&(x), NULL)
|
||||||
#define LOCK(x) pthread_mutex_lock(&(x))
|
#define LOCK(x) pthread_mutex_lock(&(x))
|
||||||
#define UNLOCK(x) pthread_mutex_unlock(&(x))
|
#define UNLOCK(x) pthread_mutex_unlock(&(x))
|
||||||
|
|
||||||
#define BSWAP32(v) __builtin_bswap32(v)
|
|
||||||
#define BSWAP64(v) __builtin_bswap64(v)
|
|
||||||
#else
|
#else
|
||||||
#define LOCK_T HANDLE
|
#define LOCK_T HANDLE
|
||||||
#define LOCK_INIT(x) do { x = CreateMutex(NULL, FALSE, NULL); } while (0)
|
#define LOCK_INIT(x) do { x = CreateMutex(NULL, FALSE, NULL); } while (0)
|
||||||
#define LOCK(x) WaitForSingleObject(x, INFINITE)
|
#define LOCK(x) WaitForSingleObject(x, INFINITE)
|
||||||
#define UNLOCK(x) ReleaseMutex(x)
|
#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 BSWAP32(v) _byteswap_ulong(v)
|
||||||
#define BSWAP64(v) _byteswap_uint64(v)
|
#define BSWAP64(v) _byteswap_uint64(v)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue