]> git.sesse.net Git - stockfish/blobdiff - src/types.h
Use thread_local compiler specifics
[stockfish] / src / types.h
index b9964971ddb19fa4cfeb485c3abc6cd6900247b7..2a3b41fab8f7ee234852deb6b9498f97fd72a031 100644 (file)
 #  define FORCE_INLINE  inline
 #endif
 
+#if defined(__GNUC__)
+#  define THREAD_LOCAL  __thread
+#else
+#  define THREAD_LOCAL  __declspec(thread)
+#endif
+
 #if defined(USE_POPCNT)
 const bool HasPopCnt = true;
 #else
@@ -327,7 +333,7 @@ inline Color operator~(Color c) {
 }
 
 inline Square operator~(Square s) {
-  return Square(s ^ 56);
+  return Square(s ^ 56); // Vertical flip SQ_A1 -> SQ_A8
 }
 
 inline Value mate_in(int ply) {
@@ -354,7 +360,7 @@ inline Square make_square(File f, Rank r) {
   return Square((r << 3) | f);
 }
 
-inline bool square_is_ok(Square s) {
+inline bool is_ok(Square s) {
   return s >= SQ_A1 && s <= SQ_H8;
 }
 
@@ -367,7 +373,7 @@ inline Rank rank_of(Square s) {
 }
 
 inline Square mirror(Square s) {
-  return Square(s ^ 7);
+  return Square(s ^ 7); // Horizontal flip SQ_A1 -> SQ_H1
 }
 
 inline Square relative_square(Color c, Square s) {