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