23 #error "MAXTIME is no longer supported - please use command-line options --checks-max-time=, --template-max-time= and --typedef-max-time= instead"
27 # ifdef CPPCHECKLIB_EXPORT
28 # define CPPCHECKLIB __declspec(dllexport)
29 # elif defined(CPPCHECKLIB_IMPORT)
30 # define CPPCHECKLIB __declspec(dllimport)
39 #if !defined(DISABLE_CRTDBG_MAP_ALLOC) && defined(_MSC_VER) && defined(_DEBUG)
40 # define _CRTDBG_MAP_ALLOC
46 #define __has_builtin(x) 0
50 #define __has_include(x) 0
53 #ifndef __has_cpp_attribute
54 #define __has_cpp_attribute(x) 0
58 #define __has_feature(x) 0
62 #if defined(__cpp_noexcept_function_type) || \
63 (defined(__GNUC__) && (__GNUC__ >= 5)) \
64 || defined(__clang__) \
65 || defined(__CPPCHECK__)
66 # define NOEXCEPT noexcept
72 #if __has_cpp_attribute (noreturn) \
73 || (defined(__GNUC__) && (__GNUC__ >= 5)) \
74 || defined(__clang__) \
75 || defined(__CPPCHECK__)
76 # define NORETURN [[noreturn]]
77 #elif defined(__GNUC__)
78 # define NORETURN __attribute__((noreturn))
84 #if __cplusplus >= 201703L && __has_cpp_attribute (fallthrough)
85 # define FALLTHROUGH [[fallthrough]]
86 #elif defined(__clang__)
87 # define FALLTHROUGH [[clang::fallthrough]]
88 #elif (defined(__GNUC__) && (__GNUC__ >= 7))
89 # define FALLTHROUGH __attribute__((fallthrough))
95 #if __cplusplus >= 201703L && __has_cpp_attribute (maybe_unused)
96 # define UNUSED [[maybe_unused]]
97 #elif defined(__GNUC__) \
98 || defined(__clang__) \
99 || defined(__CPPCHECK__)
100 # define UNUSED __attribute__((unused))
106 #if __has_cpp_attribute (gnu::warn_unused) || \
107 (defined(__clang__) && (__clang_major__ >= 15))
108 # define WARN_UNUSED [[gnu::warn_unused]]
114 #if defined(__GNUC__) \
115 || defined(__clang__) \
116 || defined(__CPPCHECK__)
117 # define DEPRECATED __attribute__((deprecated))
118 #elif defined(_MSC_VER)
119 # define DEPRECATED __declspec(deprecated)
124 #define REQUIRES(msg, ...) class=typename std::enable_if<__VA_ARGS__::value>::type
131 #define nonneg __cppcheck_low__(0)
132 #elif defined(NONNEG)
135 #define nonneg unsigned
141 #if __has_feature(address_sanitizer)
146 #ifdef __SANITIZE_ADDRESS__
154 #define HAS_THREADING_MODEL_THREAD
155 #define STDCALL __stdcall
156 #elif ((defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)) || defined(__CPPCHECK__)
157 #define HAS_THREADING_MODEL_FORK
158 #if !defined(DISALLOW_THREAD_EXECUTOR)
159 #define HAS_THREADING_MODEL_THREAD
163 #error "No threading model defined"
166 #define STRINGISIZE(...) #__VA_ARGS__
169 #define SUPPRESS_WARNING_PUSH(warning) _Pragma("clang diagnostic push") _Pragma(STRINGISIZE(clang diagnostic ignored warning))
170 #define SUPPRESS_WARNING_POP _Pragma("clang diagnostic pop")
171 #define SUPPRESS_WARNING_GCC_PUSH(warning)
172 #define SUPPRESS_WARNING_GCC_POP
173 #define SUPPRESS_WARNING_CLANG_PUSH(warning) SUPPRESS_WARNING_PUSH(warning)
174 #define SUPPRESS_WARNING_CLANG_POP SUPPRESS_WARNING_POP
175 #elif defined(__GNUC__)
176 #define SUPPRESS_WARNING_PUSH(warning) _Pragma("GCC diagnostic push") _Pragma(STRINGISIZE(GCC diagnostic ignored warning))
177 #define SUPPRESS_WARNING_POP _Pragma("GCC diagnostic pop")
178 #define SUPPRESS_WARNING_GCC_PUSH(warning) SUPPRESS_WARNING_PUSH(warning)
179 #define SUPPRESS_WARNING_GCC_POP SUPPRESS_WARNING_POP
180 #define SUPPRESS_WARNING_CLANG_PUSH(warning)
181 #define SUPPRESS_WARNING_CLANG_POP
183 #define SUPPRESS_WARNING_PUSH(warning)
184 #define SUPPRESS_WARNING_POP
185 #define SUPPRESS_WARNING_GCC_PUSH(warning)
186 #define SUPPRESS_WARNING_GCC_POP
187 #define SUPPRESS_WARNING_CLANG_PUSH(warning)
188 #define SUPPRESS_WARNING_CLANG_POP
191 #if !defined(NO_WINDOWS_SEH) && defined(_WIN32) && defined(_MSC_VER)
192 #define USE_WINDOWS_SEH
196 #if !defined(NO_UNIX_BACKTRACE_SUPPORT) && defined(__GNUC__) && defined(__GLIBC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__NetBSD__) && !defined(__SVR4) && !defined(__QNX__)
197 #define USE_UNIX_BACKTRACE_SUPPORT
200 #if !defined(NO_UNIX_SIGNAL_HANDLING) && defined(__GNUC__) && !defined(__MINGW32__) && !defined(__OS2__)
201 #define USE_UNIX_SIGNAL_HANDLING
static const std::string emptyString