]> git.sesse.net Git - stockfish/blob - src/types.h
0819ff11d1019936c6c29be47008a97ac44cfda4
[stockfish] / src / types.h
1 /*
2   Stockfish, a UCI chess playing engine derived from Glaurung 2.1
3   Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
4   Copyright (C) 2008-2009 Marco Costalba
5
6   Stockfish is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   Stockfish is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21 #if !defined(TYPES_H_INCLUDED)
22 #define TYPES_H_INCLUDED
23
24 #if !defined(_MSC_VER)
25
26 #include <inttypes.h>
27
28 #else
29
30 typedef __int8 int8_t;
31 typedef unsigned __int8 uint8_t;
32 typedef __int16 int16;
33 typedef unsigned __int16 uint16_t;
34 typedef __int32 int32_t;
35 typedef unsigned __int32 uint32_t;
36 typedef __int64 int64;
37 typedef unsigned __int64 uint64_t;
38
39 typedef __int16 int16_t;
40 typedef __int64 int64_t;
41
42 #endif // !defined(_MSC_VER)
43
44 // Hash keys
45 typedef uint64_t Key;
46
47 // Bitboard type
48 typedef uint64_t Bitboard;
49
50
51 ////
52 //// Compiler specific defines
53 ////
54
55 // Quiet a warning on Intel compiler
56 #if !defined(__SIZEOF_INT__ )
57 #define __SIZEOF_INT__ 0
58 #endif
59
60 // Check for 64 bits for different compilers: Intel, MSVC and gcc
61 #if defined(__x86_64) || defined(_M_X64) || defined(_WIN64) || (__SIZEOF_INT__ > 4)
62 #define IS_64BIT
63 #endif
64
65 #if defined(IS_64BIT) && !defined(_WIN64) && (defined(__GNUC__) || defined(__INTEL_COMPILER))
66 #define USE_BSFQ
67 #endif
68
69 #endif // !defined(TYPES_H_INCLUDED)