24 #ifndef LOG4CPLUS_CONFIG_HXX
25 #define LOG4CPLUS_CONFIG_HXX
29 #elif (defined(__MWERKS__) && defined(__MACOS__))
32 # include <log4cplus/config/defines.hxx>
35 # if ! defined (LOG4CPLUS_WORKING_LOCALE) \
36 && ! defined (LOG4CPLUS_WORKING_C_LOCALE) \
37 && ! defined (LOG4CPLUS_WITH_ICONV)
38 # define LOG4CPLUS_POOR_MANS_CHCONV
41 #ifndef LOG4CPLUS_DECLSPEC_EXPORT
42 #define LOG4CPLUS_DECLSPEC_EXPORT
45 #ifndef LOG4CPLUS_DECLSPEC_IMPORT
46 #define LOG4CPLUS_DECLSPEC_IMPORT
49 #ifndef LOG4CPLUS_DECLSPEC_PRIVATE
50 #define LOG4CPLUS_DECLSPEC_PRIVATE
53 #define LOG4CPLUS_PRIVATE LOG4CPLUS_DECLSPEC_PRIVATE
56 # define LOG4CPLUS_USE_BSD_SOCKETS
57 # if !defined(LOG4CPLUS_SINGLE_THREADED)
58 # define LOG4CPLUS_USE_PTHREADS
60 # if defined (INSIDE_LOG4CPLUS)
61 # define LOG4CPLUS_EXPORT LOG4CPLUS_DECLSPEC_EXPORT
63 # define LOG4CPLUS_EXPORT LOG4CPLUS_DECLSPEC_IMPORT
68 #if defined (LOG4CPLUS_INLINES_ARE_EXPORTED) \
69 && defined (LOG4CPLUS_BUILD_DLL)
70 # define LOG4CPLUS_INLINE_EXPORT inline
72 # define LOG4CPLUS_INLINE_EXPORT
76 # if defined (_MSC_VER) && _MSC_VER >= 1400
77 # define LOG4CPLUS_FSTREAM_ACCEPTS_WCHAR_T
79 # if defined (_MSC_VER) && _MSC_VER >= 1600
80 # define LOG4CPLUS_HAVE_CODECVT_UTF8_FACET
81 # define LOG4CPLUS_HAVE_CODECVT_UTF16_FACET
87 #if ! defined (__has_feature)
90 # define __has_feature(X) 0
93 #if __has_feature (cxx_noexcept) \
94 || (defined (__GNUC__) \
96 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \
97 || (defined (_MSC_VER) && _MSC_VER >= 1900)
98 # define LOG4CPLUS_NOEXCEPT noexcept
99 # define LOG4CPLUS_NOEXCEPT_FALSE noexcept(false)
101 # define LOG4CPLUS_NOEXCEPT
102 # define LOG4CPLUS_NOEXCEPT_FALSE
105 #if ! defined (UNICODE) && defined (__GNUC__) && __GNUC__ >= 3
106 # define LOG4CPLUS_FORMAT_ATTRIBUTE(archetype, format_index, first_arg_index) \
107 __attribute__ ((format (archetype, format_index, first_arg_index)))
109 # define LOG4CPLUS_FORMAT_ATTRIBUTE(archetype, fmt_index, first_arg_index) \
113 #if defined (__GNUC__) \
114 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) \
115 && ! defined (__INTEL_COMPILER) \
116 && ! defined (__CUDACC__)
117 # define LOG4CPLUS_CALLER_FILE() __builtin_FILE ()
118 # define LOG4CPLUS_CALLER_LINE() __builtin_LINE ()
119 # define LOG4CPLUS_CALLER_FUNCTION() __builtin_FUNCTION ()
121 # define LOG4CPLUS_CALLER_FILE() (nullptr)
122 # define LOG4CPLUS_CALLER_LINE() (-1)
123 # define LOG4CPLUS_CALLER_FUNCTION() (nullptr)
126 #if defined (__GNUC__) && __GNUC__ >= 3
127 # define LOG4CPLUS_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
128 # define LOG4CPLUS_ATTRIBUTE_PURE __attribute__ ((__pure__))
129 # define LOG4CPLUS_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
130 # define LOG4CPLUS_BUILTIN_EXPECT(exp, c) __builtin_expect ((exp), (c))
132 # if ! defined (LOG4CPLUS_ATTRIBUTE_NORETURN)
133 # define LOG4CPLUS_ATTRIBUTE_NORETURN
135 # define LOG4CPLUS_ATTRIBUTE_PURE
136 # define LOG4CPLUS_ATTRIBUTE_DEPRECATED
137 # define LOG4CPLUS_BUILTIN_EXPECT(exp, c) (exp)
140 #define LOG4CPLUS_LIKELY(cond) LOG4CPLUS_BUILTIN_EXPECT(!! (cond), 1)
141 #define LOG4CPLUS_UNLIKELY(cond) LOG4CPLUS_BUILTIN_EXPECT(!! (cond), 0)
143 #if defined (_MSC_VER) \
144 || (defined (__BORLANDC__) && __BORLANDC__ >= 0x0650) \
145 || (defined (__COMO__) && __COMO_VERSION__ >= 400) \
146 || (defined (__DMC__) && __DMC__ >= 0x700) \
147 || (defined (__clang__) && __clang_major__ >= 3) \
148 || (defined (__GNUC__) && (__GNUC__ >= 4 \
149 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)))
150 # define LOG4CPLUS_HAVE_PRAGMA_ONCE
154 #if defined (LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY)
155 # define LOG4CPLUS_CONSTRUCTOR_FUNC(prio) \
156 __attribute__ ((__constructor__ ((prio))))
157 #elif defined (LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR)
158 # define LOG4CPLUS_CONSTRUCTOR_FUNC(prio) \
159 __attribute__ ((__constructor__))
161 # define LOG4CPLUS_CONSTRUCTOR_FUNC(prio)
164 #if defined (LOG4CPLUS_HAVE_VAR_ATTRIBUTE_INIT_PRIORITY)
165 # define LOG4CPLUS_INIT_PRIORITY(prio) \
166 __attribute__ ((__init_priority__ ((prio))))
168 # define LOG4CPLUS_INIT_PRIORITY(prio)
171 #define LOG4CPLUS_INIT_PRIORITY_BASE (65535 / 2)
175 #if defined (LOG4CPLUS_SINGLE_THREADED)
176 #define LOG4CPLUS_THREADED(x)
178 #define LOG4CPLUS_THREADED(x) x
181 #if defined(__cplusplus)