2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2013-2014, 2017, 2021 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2013-2014, 2016 Attila Molnar <attilamolnar@hush.com>
7 * This file is part of InspIRCd. InspIRCd is free software: you can
8 * redistribute it and/or modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation, version 2.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * Some implementations of the C++11 standard library are incomplete so we use
25 * the implementation of the same types from C++ Technical Report 1 instead.
27 #if defined _LIBCPP_VERSION || defined _WIN32 || __cplusplus >= 201103L
30 # include <functional>
31 # include <unordered_map>
32 # include <type_traits>
34 # define TR1NS std::tr1
36 # include <tr1/functional>
37 # include <tr1/unordered_map>
38 # include <tr1/type_traits>
42 * This macro enables the compile-time checking of printf format strings. This
43 * makes the compiler show a warning if the format of a printf arguments are
46 #if defined __clang__ || defined __GNUC__
47 # define CUSTOM_PRINTF(stringpos, firstpos) __attribute__((format(printf, stringpos, firstpos)))
49 # define CUSTOM_PRINTF(stringpos, firstpos)
53 * These macros enable the use of the C++11 override control keywords in
54 * compilers which support them.
56 #if __cplusplus >= 201103L
57 # define HAS_CXX11_FINAL_OVERRIDE
58 #elif defined __clang__
59 # if __has_feature(cxx_override_control)
60 # define HAS_CXX11_FINAL_OVERRIDE
62 #elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
63 # if defined __GXX_EXPERIMENTAL_CXX0X__
64 # define HAS_CXX11_FINAL_OVERRIDE
66 #elif _MSC_VER >= 1700
67 # define HAS_CXX11_FINAL_OVERRIDE
70 #if defined HAS_CXX11_FINAL_OVERRIDE
71 # define CXX11_FINAL final
72 # define CXX11_OVERRIDE override
75 # define CXX11_OVERRIDE
79 * This macro allows methods to be marked as deprecated. To use this, wrap the
80 * method declaration in the header file with the macro.
82 #if defined __clang__ || defined __GNUC__
83 # define DEPRECATED_METHOD(function) function __attribute__((deprecated))
84 #elif defined _MSC_VER
85 # define DEPRECATED_METHOD(function) __declspec(deprecated) function
87 # define DEPRECATED_METHOD(function) function
91 * Windows is very different to UNIX so we have to wrap certain features in
92 * order to build on Windows correctly.
95 # include "inspircd_win32wrapper.h"
96 # include "threadengines/threadengine_win32.h"
98 # define ENTRYPOINT int main(int argc, char** argv)
99 # define DllExport __attribute__ ((visibility ("default")))
100 # define CoreExport __attribute__ ((visibility ("default")))
102 # include "threadengines/threadengine_pthread.h"