The Battle for Wesnoth  1.15.12+dev
global.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #ifdef _MSC_VER
18 #endif //_MSC_VER
19 
20 #ifdef NDEBUG
21 /*
22  * Wesnoth uses asserts to avoid undefined behaviour. For example, to make sure
23  * pointers are not nullptr before dereferencing them, or collections are not empty
24  * before accessing their elements. Therefore Wesnoth should not be compiled
25  * with assertions disabled.
26  */
27 #error "Compilation with NDEBUG defined isn't supported, Wesnoth depends on asserts."
28 #endif
29 
30 #define UNUSED(x) ((void)(x)) /* to avoid warnings */
31 
32 // To allow using some optional C++20 features (TODO: use the actual C++20 value once that's finalized)
33 #if __cplusplus > 201703L
34 #define HAVE_CXX20
35 #endif
36 
37 #if defined(__clang__)
38 #endif
39 
40 #if defined(__GNUC__) && !defined(__clang__)
41 #endif