]> git.sesse.net Git - stockfish/blobdiff - src/syzygy/tbcore.h
LMR Simplification
[stockfish] / src / syzygy / tbcore.h
index b80298e6a46505dfa05b5e3db37aac6f6fa8419c..cdaf2aca9cda8dda3152525fd1198e40a0a5d068 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef TBCORE_H
 #define TBCORE_H
 
 #ifndef TBCORE_H
 #define TBCORE_H
 
-#ifndef __WIN32__
+#ifndef _WIN32
 #include <pthread.h>
 #define SEP_CHAR ':'
 #define FD int
 #include <pthread.h>
 #define SEP_CHAR ':'
 #define FD int
@@ -17,7 +17,7 @@
 #define FD_ERR INVALID_HANDLE_VALUE
 #endif
 
 #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 LOCK_T pthread_mutex_t
 #define LOCK_INIT(x) pthread_mutex_init(&(x), NULL)
 #define LOCK(x) pthread_mutex_lock(&(x))
 #define UNLOCK(x) ReleaseMutex(x)
 #endif
 
 #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
+
 #define WDLSUFFIX ".rtbw"
 #define DTZSUFFIX ".rtbz"
 #define WDLDIR "RTBWDIR"
 #define WDLSUFFIX ".rtbw"
 #define DTZSUFFIX ".rtbz"
 #define WDLDIR "RTBWDIR"
@@ -70,7 +78,11 @@ struct TBEntry {
   ubyte num;
   ubyte symmetric;
   ubyte has_pawns;
   ubyte num;
   ubyte symmetric;
   ubyte has_pawns;
-} __attribute__((__may_alias__));
+}
+#ifndef _WIN32
+__attribute__((__may_alias__))
+#endif
+;
 
 struct TBEntry_piece {
   char *data;
 
 struct TBEntry_piece {
   char *data;