]> git.sesse.net Git - stockfish/blobdiff - src/types.h
Assorted code style and comments in pawns.cpp and pawns.h
[stockfish] / src / types.h
index a5502c2f5df2f1e143494231aa53b971f68cfb21..f5e30c7401bc82a14fd37d47bbc7b55082475a07 100644 (file)
@@ -77,9 +77,8 @@ typedef unsigned __int64 uint64_t;
 #define IS_64BIT
 #endif
 
-// Automatic detection for use of bsfq asm-instruction under Windows.
-// Works only in 64-bit mode. Does not work with MSVC.
-#if defined(_WIN64) && defined(__INTEL_COMPILER)
+// Automatic detection for use of bsfq asm-instruction under Windows
+#if defined(_WIN64)
 #define USE_BSFQ
 #endif
 
@@ -159,6 +158,9 @@ const bool CpuIs64Bit = false;
 typedef uint64_t Key;
 typedef uint64_t Bitboard;
 
+const int PLY_MAX = 100;
+const int PLY_MAX_PLUS_2 = PLY_MAX + 2;
+
 enum ValueType {
   VALUE_TYPE_NONE  = 0,
   VALUE_TYPE_UPPER = 1,
@@ -173,6 +175,10 @@ enum Value {
   VALUE_MATE      = 30000,
   VALUE_INFINITE  = 30001,
   VALUE_NONE      = 30002,
+
+  VALUE_MATE_IN_PLY_MAX  =  VALUE_MATE - PLY_MAX,
+  VALUE_MATED_IN_PLY_MAX = -VALUE_MATE + PLY_MAX,
+
   VALUE_ENSURE_INTEGER_SIZE_P = INT_MAX,
   VALUE_ENSURE_INTEGER_SIZE_N = INT_MIN
 };
@@ -457,4 +463,8 @@ inline bool square_is_ok(Square s) {
   return s >= SQ_A1 && s <= SQ_H8;
 }
 
+inline Square pawn_push(Color c) {
+  return c == WHITE ? DELTA_N : DELTA_S;
+}
+
 #endif // !defined(TYPES_H_INCLUDED)