Add auto configuration for 32/64 bits
authorMarco Costalba <mcostalba@gmail.com>
Wed, 24 Sep 2008 21:23:58 +0000 (22:23 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 25 Sep 2008 05:51:56 +0000 (07:51 +0200)
Instead of manually adjust defines in bitboard.h
now proper ones are automatically set.

It is anyhow possible to still set them manually
in case of problems.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/bitboard.h

index d9a9bf5dfd219c73240658b27dfc84056b7cf2ed..9fbcbf724b2bc7704ac3548724189b9757f8076e 100644 (file)
 //// Defines
 ////
 
+// Comment following define if you prefer manually adjust
+// platform macros defined below
+#define AUTO_CONFIGURATION
+
+
+// Check for 64 bits for different compilers: Intel, MSVC and gcc
+#if defined(__x86_64) || defined(_WIN64) || (__SIZEOF_INT__ > 4)
+#define IS_64BIT
+#endif
+
+#if !defined(AUTO_CONFIGURATION) || defined(IS_64BIT)
+
 //#define USE_COMPACT_ROOK_ATTACKS
 //#define USE_32BIT_ATTACKS 
 #define USE_FOLDED_BITSCAN
 //#define BITCOUNT_SWAR_32
 //#define BITCOUNT_LOOP
 
+#else
+
+#define USE_32BIT_ATTACKS 
+#define USE_FOLDED_BITSCAN
+#define BITCOUNT_SWAR_32
 
+#endif
 
 ////
 //// Includes