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