Belofte version 2.1.9
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"
105/// @todo add iOS specifics
106#endif
107#endif
108
109#if !defined(MYOS)
110#if defined(__linux__)
111#define MYOS "Linux"
112#endif
113#endif
114
115/// no matching OS @todo add more OSes
116#if !defined(MYOS)
117#define MYOS "-"
118#endif
119
120// --------------------------------------------------------------------
121
122#if defined(_WIN32) || defined(WIN32)
123/// @todo find a better way to compile on windows and retain unicode
124#if !defined(BELOFTE_NOUNICODE)
125#define BELOFTE_NOUNICODE 1
126#endif
127#endif
128
129#if defined(__INTEL_COMPILER)
130#endif
131
132#if defined(_MSC_VER)
133#pragma warning( disable : 4100 )
134#define UNUSED
135#endif
136
137#if defined(__GNUC__)
138#define UNUSED __attribute__((unused))
139#endif
140
141#if defined(__DEBUG__) && !defined(_DEBUG)
142#define _DEBUG 1
143#endif
144
145#if !defined(_DEBUG)
146#define NPS_LOG 1
147#endif
148
149#if __cplusplus < 201103L
150#error "C++11 or higher required"
151#endif
152
153#define B_VALUE(x) B_HELPER(x)
154#define B_HELPER(x) #x
155#if defined(__clang__)
156#define BELOFTE_COMPILER "clang " B_VALUE(__clang_major__) "." \
157 B_VALUE(__clang_minor__) "." B_VALUE(__clang_patchlevel__)
158#elif defined(__GNUC__) || defined(__GNUG__)
159#define BELOFTE_COMPILER "gcc " B_VALUE(__GNUC__) "." \
160 B_VALUE(__GNUC_MINOR__) "." B_VALUE(__GNUC_PATCHLEVEL__)
161#else
162#define BELOFTE_COMPILER "other compiler"
163#endif
164
165#if defined(__GNUC__) && !defined(__clang__)
166#if __GNUC__ < 6
167#if !defined(INCOMPLETE_C11)
168#define INCOMPLETE_C11 1
169#endif
170#endif
171#endif
172
173#if defined(__APPLE_CC__)
174#if !defined(CHRONO_MISSING)
175#define CHRONO_MISSING 1
176#endif
177#endif
178
179#if defined(__ANDROID__)
180#define BELOFTE_UCIMODE 1
181#endif
182
183#if defined(_WIN32) && defined(DEVCPP)
184#define MEMBER_CONSTEXPR inline
185#else
186#define MEMBER_CONSTEXPR constexpr
187#endif
188
189#endif // defined MYPLATFORM_H
190
191// eof