X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsyzygy%2Ftbcore.h;h=e47acfc3f07c60fa04012d6fb81d0ffe65600c2b;hp=b80298e6a46505dfa05b5e3db37aac6f6fa8419c;hb=afafdf7b73295b54a4027d88748599ff20f61759;hpb=7caa6cd3383cf90189a1947c9bdf9c6fea1172a6 diff --git a/src/syzygy/tbcore.h b/src/syzygy/tbcore.h index b80298e6..e47acfc3 100644 --- a/src/syzygy/tbcore.h +++ b/src/syzygy/tbcore.h @@ -5,7 +5,7 @@ #ifndef TBCORE_H #define TBCORE_H -#ifndef __WIN32__ +#ifndef _WIN32 #include #define SEP_CHAR ':' #define FD int @@ -17,16 +17,22 @@ #define FD_ERR INVALID_HANDLE_VALUE #endif -#ifndef __WIN32__ +#ifndef _WIN32 #define LOCK_T pthread_mutex_t #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) + +#define BSWAP32(v) _byteswap_ulong(v) +#define BSWAP64(v) _byteswap_uint64(v) #endif #define WDLSUFFIX ".rtbw" @@ -70,7 +76,11 @@ struct TBEntry { ubyte num; ubyte symmetric; ubyte has_pawns; -} __attribute__((__may_alias__)); +} +#ifndef _WIN32 +__attribute__((__may_alias__)) +#endif +; struct TBEntry_piece { char *data;