]> granicus.if.org Git - icinga2/blob - lib/base/i2-base.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / i2-base.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef I2BASE_H
4 #define I2BASE_H
5
6 /**
7  * @mainpage Icinga Documentation
8  *
9  * Icinga implements a framework for run-time-loadable components which can
10  * pass messages between each other. These components can either be hosted in
11  * the same process or in several host processes (either on the same machine or
12  * on different machines).
13  *
14  * The framework's code critically depends on the following patterns:
15  *
16  * <list type="bullet">
17  * <item>Smart pointers
18  *
19  * The shared_ptr and weak_ptr template classes are used to simplify memory
20  * management and to avoid accidental memory leaks and use-after-free
21  * bugs.</item>
22  *
23  * <item>Observer pattern
24  *
25  * Framework classes expose events which other objects can subscribe to. This
26  * is used to decouple clients of a class from the class' internal
27  * implementation.</item>
28  * </list>
29  */
30
31 /**
32  * @defgroup base Base class library
33  *
34  * The base class library implements commonly-used functionality like
35  * event handling for sockets and timers.
36  */
37
38 #include <boost/config.hpp>
39
40 #if defined(__clang__) && __cplusplus >= 201103L
41 #       undef BOOST_NO_CXX11_HDR_TUPLE
42 #endif
43
44 #ifdef _MSC_VER
45 #       pragma warning(disable:4251)
46 #       pragma warning(disable:4275)
47 #       pragma warning(disable:4345)
48 #endif /* _MSC_VER */
49
50 #include "config.h"
51
52 #ifdef _WIN32
53 #       include "base/win32.hpp"
54 #else
55 #       include "base/unix.hpp"
56 #endif
57
58 #include <cstdlib>
59 #include <cstdarg>
60 #include <cstdio>
61 #include <cstring>
62 #include <cerrno>
63
64 #include <sys/types.h>
65 #include <sys/stat.h>
66 #include <signal.h>
67
68 #include <exception>
69 #include <stdexcept>
70
71 #if defined(__APPLE__) && defined(__MACH__)
72 #       pragma GCC diagnostic ignored "-Wdeprecated-declarations"
73 #endif
74
75 #if defined(__GNUC__)
76 #       define likely(x) __builtin_expect(!!(x), 1)
77 #       define unlikely(x) __builtin_expect(!!(x), 0)
78 #else
79 #       define likely(x) (x)
80 #       define unlikely(x) (x)
81 #endif
82
83 #define BOOST_BIND_NO_PLACEHOLDERS
84
85 #include <functional>
86
87 using namespace std::placeholders;
88
89 #endif /* I2BASE_H */