2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2013 Peter Powell <petpow@saberuk.com>
5 * Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
6 * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
8 * This file is part of InspIRCd. InspIRCd is free software: you can
9 * redistribute it and/or modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation, version 2.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * Some implementations of the C++11 standard library are incomplete so we use
26 * the implementation of the same types from C++ Technical Report 1 instead.
28 #if defined _LIBCPP_VERSION || defined _WIN32
30 # include <unordered_map>
31 # include <type_traits>
33 # define TR1NS std::tr1
34 # include <tr1/unordered_map>
35 # include <tr1/type_traits>
39 * This macro enables the compile-time checking of printf format strings. This
40 * makes the compiler show a warning if the format of a printf arguments are
43 #if defined __clang__ || defined __GNUC__
44 # define CUSTOM_PRINTF(stringpos, firstpos) __attribute__((format(printf, stringpos, firstpos)))
46 # define CUSTOM_PRINTF(stringpos, firstpos)
50 * These macros enable the use of the C++11 override control keywords in
51 * compilers which support them.
53 #if __cplusplus >= 201103L
54 # define HAS_CXX11_FINAL_OVERRIDE
55 #elif defined __clang__
56 # if __has_feature(cxx_override_control)
57 # define HAS_CXX11_FINAL_OVERRIDE
59 #elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
60 # if defined __GXX_EXPERIMENTAL_CXX0X__
61 # define HAS_CXX11_FINAL_OVERRIDE
63 #elif _MSC_VER >= 1700
64 # define HAS_CXX11_FINAL_OVERRIDE
67 #if defined HAS_CXX11_FINAL_OVERRIDE
68 # define CXX11_FINAL final
69 # define CXX11_OVERRIDE override
72 # define CXX11_OVERRIDE
76 * These macros enable the detection of the C++11 variadic templates in
77 * compilers which support them.
79 #if __cplusplus >= 201103L
80 # define HAS_CXX11_VARIADIC_TEMPLATES
81 #elif defined __clang__
82 # if __has_feature(cxx_variadic_templates)
83 # define HAS_CXX11_VARIADIC_TEMPLATES
85 #elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
86 # if defined __GXX_EXPERIMENTAL_CXX0X__
87 # define HAS_CXX11_VARIADIC_TEMPLATES
89 #elif _MSC_FULL_VER >= 170051025
90 # define HAS_CXX11_VARIADIC_TEMPLATES
94 * This macro allows methods to be marked as deprecated. To use this, wrap the
95 * method declaration in the header file with the macro.
97 #if defined __clang__ || defined __GNUC__
98 # define DEPRECATED_METHOD(function) function __attribute__((deprecated))
99 #elif defined _MSC_VER
100 # define DEPRECATED_METHOD(function) __declspec(deprecated) function
102 # define DEPRECATED_METHOD(function) function
106 * Windows is very different to UNIX so we have to wrap certain features in
107 * order to build on Windows correctly.
110 # include "inspircd_win32wrapper.h"
111 # include "threadengines/threadengine_win32.h"
113 # define ENTRYPOINT int main(int argc, char** argv)
114 # define DllExport __attribute__ ((visibility ("default")))
115 # define CoreExport __attribute__ ((visibility ("default")))
117 # include "threadengines/threadengine_pthread.h"