Belofte  version 2.1.5
A promising chess program using the UCI or Winboard interface
myplatform.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------+
2  * File: myplatform.h
3  * Project: part of belofte - A Promising Chess Program
4  * Author: yves
5  * SPDX-License-Identifier: GPL-2.0-only
6 +----------------------------------------------------------------------*/
7 
8 #if !defined(MYPLATFORM_H)
9 #define MYPLATFORM_H
10 
11 #if !defined(MYPLATFORM)
12 #if defined(__x86_64__)
13 #define MYPLATFORM "x86_64"
14 #endif
15 #endif
16 
17 #if !defined(MYPLATFORM)
18 #if defined(__i386__)
19 #define MYPLATFORM "x86"
20 #endif
21 #endif
22 
23 #if !defined(MYPLATFORM)
24 #if defined(__aarch64__)
25 #define MYPLATFORM "arm64"
26 #endif
27 #endif
28 
29 #if !defined(MYPLATFORM)
30 #if defined(__arm__)
31 #define MYPLATFORM "arm"
32 #endif
33 #endif
34 
35 #if !defined(MYPLATFORM)
36 #if defined(__powerpc__)
37 #define MYPLATFORM "ppc"
38 #endif
39 #endif
40 
41 #if !defined(MYPLATFORM)
42 #if defined(__sparc__)
43 #define MYPLATFORM "sparc"
44 #endif
45 #endif
46 
47 #if !defined(MYPLATFORM)
48 #if defined(__mips__)
49 #define MYPLATFORM "mips"
50 #endif
51 #endif
52 
53 #if !defined(MYPLATFORM)
54 #if defined(__m68k__)
55 #define MYPLATFORM "m68k"
56 #endif
57 #endif
58 
59 #if !defined(MYPLATFORM)
60 #if defined(__ia64__)
61 #define MYPLATFORM "ia64"
62 #endif
63 #endif
64 
65 #if !defined(MYPLATFORM)
66 #if defined(__hppa__)
67 #define MYPLATFORM "hppa"
68 #endif
69 #endif
70 
71 // no matching platform TODO: add more platforms
72 #if !defined(MYPLATFORM)
73 #define MYPLATFORM "-"
74 #endif
75 
76 // --------------------------------------------------------------------
77 
78 #if !defined(MYOS)
79 #if defined(__ANDROID__)
80 #define MYOS "Android"
81 #endif
82 #endif
83 
84 #if !defined(MYOS)
85 #if defined(_WIN32) || defined(WIN32)
86 #define MYOS "Windows"
87 #endif
88 #endif
89 
90 #if !defined(MYOS)
91 #if defined(__sun)
92 #define MYOS "Solaris"
93 #endif
94 #endif
95 
96 #if !defined(MYOS)
97 #if defined(__hpux)
98 #define MYOS "HP-UX"
99 #endif
100 #endif
101 
102 #if !defined(MYOS)
103 #if defined(__APPLE__)
104 #define MYOS "Mac OS/iOS"
105 #endif
106 #endif
107 
108 #if !defined(MYOS)
109 #if defined(__linux__)
110 #define MYOS "Linux"
111 #endif
112 #endif
113 
114 // no matching OS TODO: add more OSes
115 #if !defined(MYOS)
116 #define MYOS "-"
117 #endif
118 
119 // --------------------------------------------------------------------
120 
121 #if defined(_DEBUG)
122 #define DEVUNUSED UNUSED
123 #else
124 #define DEVUNUSED
125 #endif
126 
127 #if defined(_WIN32) || defined(WIN32)
128 // TODO: find a better way to compile on windows and retain unicode
129 #if !defined(BELOFTE_NOUNICODE)
130 #define BELOFTE_NOUNICODE
131 #endif
132 #endif
133 
134 #if defined(__INTEL_COMPILER)
135 #endif
136 
137 #if defined(_MSC_VER)
138 #pragma warning( disable : 4100 )
139 #define UNUSED
140 #endif
141 
142 #if defined(__GNUC__)
143 #define UNUSED __attribute__((unused))
144 #endif
145 
146 #if defined(__DEBUG__) && !defined(_DEBUG)
147 #define _DEBUG
148 #endif
149 
150 #if __cplusplus < 201103L
151 #error "C++11 or higher required"
152 #endif
153 
154 #define B_VALUE(x) B_HELPER(x)
155 #define B_HELPER(x) #x
156 #if defined(__clang__)
157 #define BELOFTE_COMPILER "clang " B_VALUE(__clang_major__) "." \
158  B_VALUE(__clang_minor__) "." B_VALUE(__clang_patchlevel__)
159 #elif defined(__GNUC__) || defined(__GNUG__)
160 #define BELOFTE_COMPILER "gcc " B_VALUE(__GNUC__) "." \
161  B_VALUE(__GNUC_MINOR__) "." B_VALUE(__GNUC_PATCHLEVEL__)
162 #else
163 #define BELOFTE_COMPILER "other compiler"
164 #endif
165 
166 #if defined(__GNUC__) && !defined(__clang__)
167 #if __GNUC__ < 6
168 #if !defined(INCOMPLETE_C11)
169 #define INCOMPLETE_C11
170 #endif
171 #endif
172 #endif
173 
174 #if defined(__APPLE_CC__)
175 #if !defined(CHRONO_MISSING)
176 #define CHRONO_MISSING
177 #endif
178 #endif
179 
180 #if defined(__ANDROID__)
181 #define BELOFTE_UCIMODE
182 #endif
183 
184 #if defined(INCOMPLETE_C11)
185 #define MEMBER_CONSTEXPR
186 #else
187 #define MEMBER_CONSTEXPR constexpr
188 #endif
189 
190 #endif // defined MYPLATFORM_H
191 
192 // eof