]> git.sesse.net Git - stockfish/blobdiff - src/bitcount.h
Fix compile errors under MSVC
[stockfish] / src / bitcount.h
index 12826a9f9a05472c6e48066c202b55e0eea158ea..a4133fb21723db8981205fdf6f0f843f580e0190 100644 (file)
@@ -48,7 +48,7 @@
 
 // Select type of intrinsic bit count instruction to use
 
-#if defined(_MSC_VER) // Microsoft compiler
+#if defined(_MSC_VER) && defined(_WIN64) // Microsoft compiler
 
 #include <intrin.h>
 
@@ -159,4 +159,9 @@ inline int count_1s_max_15(Bitboard b) {
 }
 
 
+// Global variable initialized at startup that is set to true if
+// CPU on which application runs support POPCNT intrinsic.
+
+const bool CpuHasPOPCNT = cpu_has_popcnt();
+
 #endif // !defined(BITCOUNT_H_INCLUDED)