Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:02:49

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
0009 #define CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
0010 
0011 // Detect a number of compiler features - by compiler
0012 // The following features are defined:
0013 //
0014 // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
0015 // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
0016 // CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
0017 // ****************
0018 // Note to maintainers: if new toggles are added please document them
0019 // in configuration.md, too
0020 // ****************
0021 
0022 // In general each macro has a _NO_<feature name> form
0023 // (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
0024 // Many features, at point of detection, define an _INTERNAL_ macro, so they
0025 // can be combined, en-mass, with the _NO_ forms later.
0026 
0027 #include <catch2/internal/catch_platform.hpp>
0028 #include <catch2/catch_user_config.hpp>
0029 
0030 #ifdef __cplusplus
0031 
0032 #  if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
0033 #    define CATCH_CPP14_OR_GREATER
0034 #  endif
0035 
0036 #  if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
0037 #    define CATCH_CPP17_OR_GREATER
0038 #  endif
0039 
0040 #endif
0041 
0042 // Only GCC compiler should be used in this block, so other compilers trying to
0043 // mask themselves as GCC should be ignored.
0044 #if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) && !defined(__NVCOMPILER)
0045 #    define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
0046 #    define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION  _Pragma( "GCC diagnostic pop" )
0047 
0048 // This only works on GCC 9+. so we have to also add a global suppression of Wparentheses
0049 // for older versions of GCC.
0050 #    define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
0051          _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
0052 
0053 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
0054          _Pragma( "GCC diagnostic ignored \"-Wunused-result\"" )
0055 
0056 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
0057          _Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" )
0058 
0059 #    define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
0060          _Pragma( "GCC diagnostic ignored \"-Wuseless-cast\"" )
0061 
0062 #    define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
0063          _Pragma( "GCC diagnostic ignored \"-Wshadow\"" )
0064 
0065 #    define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
0066 
0067 #endif
0068 
0069 #if defined(__NVCOMPILER)
0070 #    define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "diag push" )
0071 #    define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION  _Pragma( "diag pop" )
0072 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "diag_suppress declared_but_not_referenced" )
0073 #endif
0074 
0075 #if defined(__CUDACC__) && !defined(__clang__)
0076 #  ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
0077 // New pragmas introduced in CUDA 11.5+
0078 #    define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" )
0079 #    define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION  _Pragma( "nv_diagnostic pop" )
0080 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" )
0081 #  else
0082 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "diag_suppress 177" )
0083 #  endif
0084 #endif
0085 
0086 // clang-cl defines _MSC_VER as well as __clang__, which could cause the
0087 // start/stop internal suppression macros to be double defined.
0088 #if defined(__clang__) && !defined(_MSC_VER)
0089 
0090 #    define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
0091 #    define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION  _Pragma( "clang diagnostic pop" )
0092 
0093 #endif // __clang__ && !_MSC_VER
0094 
0095 #if defined(__clang__)
0096 
0097 // As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
0098 // which results in calls to destructors being emitted for each temporary,
0099 // without a matching initialization. In practice, this can result in something
0100 // like `std::string::~string` being called on an uninitialized value.
0101 //
0102 // For example, this code will likely segfault under IBM XL:
0103 // ```
0104 // REQUIRE(std::string("12") + "34" == "1234")
0105 // ```
0106 //
0107 // Similarly, NVHPC's implementation of `__builtin_constant_p` has a bug which
0108 // results in calls to the immediately evaluated lambda expressions to be
0109 // reported as unevaluated lambdas.
0110 // https://developer.nvidia.com/nvidia_bug/3321845.
0111 //
0112 // Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
0113 #  if !defined(__ibmxl__) && !defined(__CUDACC__) && !defined( __NVCOMPILER )
0114 #    define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
0115 #  endif
0116 
0117 
0118 #    define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
0119          _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
0120          _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
0121 
0122 #    define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
0123          _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
0124 
0125 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
0126          _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
0127 
0128 #    define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
0129          _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
0130 
0131 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
0132          _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
0133 
0134 #    define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS \
0135         _Pragma( "clang diagnostic ignored \"-Wcomma\"" )
0136 
0137 #    define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
0138         _Pragma( "clang diagnostic ignored \"-Wshadow\"" )
0139 
0140 #endif // __clang__
0141 
0142 
0143 ////////////////////////////////////////////////////////////////////////////////
0144 // We know some environments not to support full POSIX signals
0145 #if defined( CATCH_PLATFORM_WINDOWS ) ||                                       \
0146     defined( CATCH_PLATFORM_PLAYSTATION ) ||                                   \
0147     defined( __CYGWIN__ ) ||                                                   \
0148     defined( __QNX__ ) ||                                                      \
0149     defined( __EMSCRIPTEN__ ) ||                                               \
0150     defined( __DJGPP__ ) ||                                                    \
0151     defined( __OS400__ )
0152 #    define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
0153 #else
0154 #    define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
0155 #endif
0156 
0157 ////////////////////////////////////////////////////////////////////////////////
0158 // Assume that some platforms do not support getenv.
0159 #if defined(CATCH_PLATFORM_WINDOWS_UWP) || defined(CATCH_PLATFORM_PLAYSTATION)
0160 #    define CATCH_INTERNAL_CONFIG_NO_GETENV
0161 #else
0162 #    define CATCH_INTERNAL_CONFIG_GETENV
0163 #endif
0164 
0165 ////////////////////////////////////////////////////////////////////////////////
0166 // Android somehow still does not support std::to_string
0167 #if defined(__ANDROID__)
0168 #    define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
0169 #endif
0170 
0171 ////////////////////////////////////////////////////////////////////////////////
0172 // Not all Windows environments support SEH properly
0173 #if defined(__MINGW32__)
0174 #    define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
0175 #endif
0176 
0177 ////////////////////////////////////////////////////////////////////////////////
0178 // PS4
0179 #if defined(__ORBIS__)
0180 #    define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
0181 #endif
0182 
0183 ////////////////////////////////////////////////////////////////////////////////
0184 // Cygwin
0185 #ifdef __CYGWIN__
0186 
0187 // Required for some versions of Cygwin to declare gettimeofday
0188 // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
0189 #   define _BSD_SOURCE
0190 // some versions of cygwin (most) do not support std::to_string. Use the libstd check.
0191 // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
0192 # if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
0193            && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
0194 
0195 #    define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
0196 
0197 # endif
0198 #endif // __CYGWIN__
0199 
0200 ////////////////////////////////////////////////////////////////////////////////
0201 // Visual C++
0202 #if defined(_MSC_VER)
0203 
0204 // We want to defer to nvcc-specific warning suppression if we are compiled
0205 // with nvcc masquerading for MSVC.
0206 #    if !defined( __CUDACC__ )
0207 #        define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
0208             __pragma( warning( push ) )
0209 #        define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
0210             __pragma( warning( pop ) )
0211 #    endif
0212 
0213 // Universal Windows platform does not support SEH
0214 // Or console colours (or console at all...)
0215 #  if defined(CATCH_PLATFORM_WINDOWS_UWP)
0216 #    define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32
0217 #  else
0218 #    define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
0219 #  endif
0220 
0221 // MSVC traditional preprocessor needs some workaround for __VA_ARGS__
0222 // _MSVC_TRADITIONAL == 0 means new conformant preprocessor
0223 // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
0224 #  if !defined(__clang__) // Handle Clang masquerading for msvc
0225 #    if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
0226 #      define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
0227 #    endif // MSVC_TRADITIONAL
0228 #  endif // __clang__
0229 
0230 #endif // _MSC_VER
0231 
0232 #if defined(_REENTRANT) || defined(_MSC_VER)
0233 // Enable async processing, as -pthread is specified or no additional linking is required
0234 # define CATCH_INTERNAL_CONFIG_USE_ASYNC
0235 #endif // _MSC_VER
0236 
0237 ////////////////////////////////////////////////////////////////////////////////
0238 // Check if we are compiled with -fno-exceptions or equivalent
0239 #if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
0240 #  define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
0241 #endif
0242 
0243 
0244 ////////////////////////////////////////////////////////////////////////////////
0245 // Embarcadero C++Build
0246 #if defined(__BORLANDC__)
0247     #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
0248 #endif
0249 
0250 ////////////////////////////////////////////////////////////////////////////////
0251 
0252 // RTX is a special version of Windows that is real time.
0253 // This means that it is detected as Windows, but does not provide
0254 // the same set of capabilities as real Windows does.
0255 #if defined(UNDER_RTSS) || defined(RTX64_BUILD)
0256     #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
0257     #define CATCH_INTERNAL_CONFIG_NO_ASYNC
0258     #define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32
0259 #endif
0260 
0261 #if !defined(_GLIBCXX_USE_C99_MATH_TR1)
0262 #define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
0263 #endif
0264 
0265 // Various stdlib support checks that require __has_include
0266 #if defined(__has_include)
0267   // Check if string_view is available and usable
0268   #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
0269   #    define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
0270   #endif
0271 
0272   // Check if optional is available and usable
0273   #  if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
0274   #    define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
0275   #  endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
0276 
0277   // Check if byte is available and usable
0278   #  if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
0279   #    include <cstddef>
0280   #    if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0)
0281   #      define CATCH_INTERNAL_CONFIG_CPP17_BYTE
0282   #    endif
0283   #  endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
0284 
0285   // Check if variant is available and usable
0286   #  if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
0287   #    if defined(__clang__) && (__clang_major__ < 8)
0288          // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
0289          // fix should be in clang 8, workaround in libstdc++ 8.2
0290   #      include <ciso646>
0291   #      if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
0292   #        define CATCH_CONFIG_NO_CPP17_VARIANT
0293   #      else
0294   #        define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
0295   #      endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
0296   #    else
0297   #      define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
0298   #    endif // defined(__clang__) && (__clang_major__ < 8)
0299   #  endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
0300 #endif // defined(__has_include)
0301 
0302 
0303 #if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
0304 #   define CATCH_CONFIG_WINDOWS_SEH
0305 #endif
0306 // This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
0307 #if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
0308 #   define CATCH_CONFIG_POSIX_SIGNALS
0309 #endif
0310 
0311 #if defined(CATCH_INTERNAL_CONFIG_GETENV) && !defined(CATCH_INTERNAL_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_GETENV)
0312 #   define CATCH_CONFIG_GETENV
0313 #endif
0314 
0315 #if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
0316 #    define CATCH_CONFIG_CPP11_TO_STRING
0317 #endif
0318 
0319 #if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
0320 #  define CATCH_CONFIG_CPP17_OPTIONAL
0321 #endif
0322 
0323 #if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
0324 #  define CATCH_CONFIG_CPP17_STRING_VIEW
0325 #endif
0326 
0327 #if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
0328 #  define CATCH_CONFIG_CPP17_VARIANT
0329 #endif
0330 
0331 #if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
0332 #  define CATCH_CONFIG_CPP17_BYTE
0333 #endif
0334 
0335 
0336 #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
0337 #  define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
0338 #endif
0339 
0340 #if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE)
0341 #  define CATCH_CONFIG_NEW_CAPTURE
0342 #endif
0343 
0344 #if !defined( CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED ) && \
0345     !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) &&          \
0346     !defined( CATCH_CONFIG_NO_DISABLE_EXCEPTIONS )
0347 #  define CATCH_CONFIG_DISABLE_EXCEPTIONS
0348 #endif
0349 
0350 #if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
0351 #  define CATCH_CONFIG_POLYFILL_ISNAN
0352 #endif
0353 
0354 #if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC)  && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
0355 #  define CATCH_CONFIG_USE_ASYNC
0356 #endif
0357 
0358 #if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
0359 #  define CATCH_CONFIG_GLOBAL_NEXTAFTER
0360 #endif
0361 
0362 
0363 // Even if we do not think the compiler has that warning, we still have
0364 // to provide a macro that can be used by the code.
0365 #if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
0366 #   define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
0367 #endif
0368 #if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
0369 #   define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
0370 #endif
0371 #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
0372 #   define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
0373 #endif
0374 #if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
0375 #   define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
0376 #endif
0377 #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT)
0378 #   define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT
0379 #endif
0380 #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS)
0381 #   define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
0382 #endif
0383 #if !defined(CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS)
0384 #   define CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS
0385 #endif
0386 #if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
0387 #   define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
0388 #endif
0389 #if !defined( CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS )
0390 #    define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
0391 #endif
0392 #if !defined( CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS )
0393 #    define CATCH_INTERNAL_SUPPRESS_COMMA_WARNINGS
0394 #endif
0395 #if !defined( CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS )
0396 #    define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS
0397 #endif
0398 
0399 
0400 // The goal of this macro is to avoid evaluation of the arguments, but
0401 // still have the compiler warn on problems inside...
0402 #if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN)
0403 #   define CATCH_INTERNAL_IGNORE_BUT_WARN(...)
0404 #endif
0405 
0406 #if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
0407 #   undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
0408 #elif defined(__clang__) && (__clang_major__ < 5)
0409 #   undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
0410 #endif
0411 
0412 
0413 #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
0414 #define CATCH_TRY if ((true))
0415 #define CATCH_CATCH_ALL if ((false))
0416 #define CATCH_CATCH_ANON(type) if ((false))
0417 #else
0418 #define CATCH_TRY try
0419 #define CATCH_CATCH_ALL catch (...)
0420 #define CATCH_CATCH_ANON(type) catch (type)
0421 #endif
0422 
0423 #if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
0424 #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
0425 #endif
0426 
0427 #if defined( CATCH_PLATFORM_WINDOWS ) &&       \
0428     !defined( CATCH_CONFIG_COLOUR_WIN32 ) && \
0429     !defined( CATCH_CONFIG_NO_COLOUR_WIN32 ) && \
0430     !defined( CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 )
0431 #    define CATCH_CONFIG_COLOUR_WIN32
0432 #endif
0433 
0434 #if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \
0435     !defined( CATCH_CONFIG_STATIC )
0436 #    ifdef Catch2_EXPORTS
0437 #        define CATCH_EXPORT //__declspec( dllexport ) // not needed
0438 #    else
0439 #        define CATCH_EXPORT __declspec( dllimport )
0440 #    endif
0441 #else
0442 #    define CATCH_EXPORT
0443 #endif
0444 
0445 #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED