Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Created by Phil on 15/04/2013. |
| 3 | * Copyright 2013 Two Blue Cubes Ltd. All rights reserved. |
| 4 | * |
| 5 | * Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 6 | * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 7 | */ |
| 8 | #ifndef TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED |
| 9 | #define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED |
| 10 | |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 11 | // Detect a number of compiler features - mostly C++11/14 conformance - by compiler |
| 12 | // The following features are defined: |
| 13 | // |
| 14 | // CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported? |
| 15 | // CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported? |
| 16 | // CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods |
| 17 | // CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported? |
| 18 | // CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported |
Phil Nash | 733ebb6 | 2015-07-23 19:03:33 +0100 | [diff] [blame] | 19 | // CATCH_CONFIG_CPP11_LONG_LONG : is long long supported? |
Phil Nash | 4cb7476 | 2015-08-05 19:02:17 +0100 | [diff] [blame] | 20 | // CATCH_CONFIG_CPP11_OVERRIDE : is override supported? |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 21 | // CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr) |
Martin Hořeňovský | 60a9ac7 | 2017-01-26 18:47:29 +0100 | [diff] [blame] | 22 | // CATCH_CONFIG_CPP11_SHUFFLE : is std::shuffle supported? |
| 23 | // CATCH_CONFIG_CPP11_TYPE_TRAITS : are type_traits and enable_if supported? |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 24 | |
| 25 | // CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported? |
| 26 | |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 27 | // CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported? |
Phil Nash | 13a887a | 2015-12-15 07:50:51 +0000 | [diff] [blame] | 28 | // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? |
Martin Hořeňovský | e991c00 | 2017-02-06 01:43:53 +0100 | [diff] [blame] | 29 | // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? |
Martin Hořeňovský | c617860 | 2017-02-15 17:57:22 +0100 | [diff] [blame] | 30 | // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 31 | // **************** |
| 32 | // Note to maintainers: if new toggles are added please document them |
| 33 | // in configuration.md, too |
| 34 | // **************** |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 35 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 36 | // In general each macro has a _NO_<feature name> form |
| 37 | // (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature. |
| 38 | // Many features, at point of detection, define an _INTERNAL_ macro, so they |
| 39 | // can be combined, en-mass, with the _NO_ forms later. |
| 40 | |
| 41 | // All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11 |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 42 | |
Phil Nash | be3570e | 2016-06-09 08:15:57 +0100 | [diff] [blame] | 43 | #ifdef __cplusplus |
| 44 | |
| 45 | # if __cplusplus >= 201103L |
| 46 | # define CATCH_CPP11_OR_GREATER |
| 47 | # endif |
| 48 | |
| 49 | # if __cplusplus >= 201402L |
| 50 | # define CATCH_CPP14_OR_GREATER |
| 51 | # endif |
| 52 | |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 53 | #endif |
| 54 | |
Phil Nash | 563429d | 2013-12-14 14:32:26 +0000 | [diff] [blame] | 55 | #ifdef __clang__ |
Phil Nash | 563429d | 2013-12-14 14:32:26 +0000 | [diff] [blame] | 56 | |
Phil Nash | 1a6f2a0 | 2014-04-23 18:19:19 +0100 | [diff] [blame] | 57 | # if __has_feature(cxx_nullptr) |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 58 | # define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR |
Phil Nash | 1a6f2a0 | 2014-04-23 18:19:19 +0100 | [diff] [blame] | 59 | # endif |
Phil Nash | 563429d | 2013-12-14 14:32:26 +0000 | [diff] [blame] | 60 | |
Phil Nash | 1a6f2a0 | 2014-04-23 18:19:19 +0100 | [diff] [blame] | 61 | # if __has_feature(cxx_noexcept) |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 62 | # define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT |
Phil Nash | 1a6f2a0 | 2014-04-23 18:19:19 +0100 | [diff] [blame] | 63 | # endif |
Phil Nash | 563429d | 2013-12-14 14:32:26 +0000 | [diff] [blame] | 64 | |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 65 | # if defined(CATCH_CPP11_OR_GREATER) |
Martin Hořeňovský | c3a41e2 | 2017-03-29 20:30:59 +0200 | [diff] [blame] | 66 | # define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ |
| 67 | _Pragma( "clang diagnostic push" ) \ |
| 68 | _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) |
| 69 | # define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ |
| 70 | _Pragma( "clang diagnostic pop" ) |
| 71 | |
Phil Nash | fe690a6 | 2017-02-15 09:38:38 +0000 | [diff] [blame] | 72 | # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ |
| 73 | _Pragma( "clang diagnostic push" ) \ |
| 74 | _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) |
| 75 | # define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ |
| 76 | _Pragma( "clang diagnostic pop" ) |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 77 | # endif |
| 78 | |
Phil Nash | 563429d | 2013-12-14 14:32:26 +0000 | [diff] [blame] | 79 | #endif // __clang__ |
| 80 | |
Martin Hořeňovský | c617860 | 2017-02-15 17:57:22 +0100 | [diff] [blame] | 81 | |
| 82 | //////////////////////////////////////////////////////////////////////////////// |
| 83 | // Cygwin |
| 84 | #ifdef __CYGWIN__ |
| 85 | |
| 86 | # if !defined(CATCH_CONFIG_POSIX_SIGNALS) |
| 87 | # define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS |
| 88 | # endif |
| 89 | |
Phil Nash | 673ec55 | 2017-03-01 15:58:57 +0000 | [diff] [blame] | 90 | // Required for some versions of Cygwin to declare gettimeofday |
| 91 | // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin |
| 92 | # define _BSD_SOURCE |
| 93 | |
Martin Hořeňovský | c617860 | 2017-02-15 17:57:22 +0100 | [diff] [blame] | 94 | #endif // __CYGWIN__ |
| 95 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 96 | //////////////////////////////////////////////////////////////////////////////// |
| 97 | // Borland |
| 98 | #ifdef __BORLANDC__ |
| 99 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 100 | |
| 101 | #endif // __BORLANDC__ |
| 102 | |
| 103 | //////////////////////////////////////////////////////////////////////////////// |
| 104 | // EDG |
| 105 | #ifdef __EDG_VERSION__ |
| 106 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 107 | |
| 108 | #endif // __EDG_VERSION__ |
| 109 | |
| 110 | //////////////////////////////////////////////////////////////////////////////// |
| 111 | // Digital Mars |
| 112 | #ifdef __DMC__ |
| 113 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 114 | |
| 115 | #endif // __DMC__ |
| 116 | |
| 117 | //////////////////////////////////////////////////////////////////////////////// |
| 118 | // GCC |
| 119 | #ifdef __GNUC__ |
| 120 | |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 121 | # if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) |
| 122 | # define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR |
| 123 | # endif |
| 124 | |
Phil Nash | fe690a6 | 2017-02-15 09:38:38 +0000 | [diff] [blame] | 125 | |
Phil Nash | f3308ed | 2015-07-27 18:34:21 +0100 | [diff] [blame] | 126 | // - otherwise more recent versions define __cplusplus >= 201103L |
| 127 | // and will get picked up below |
| 128 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 129 | |
| 130 | #endif // __GNUC__ |
| 131 | |
| 132 | //////////////////////////////////////////////////////////////////////////////// |
| 133 | // Visual C++ |
| 134 | #ifdef _MSC_VER |
| 135 | |
Martin Hořeňovský | e991c00 | 2017-02-06 01:43:53 +0100 | [diff] [blame] | 136 | #define CATCH_INTERNAL_CONFIG_WINDOWS_SEH |
| 137 | |
Phil Nash | 43470b2 | 2015-05-19 22:37:23 +0100 | [diff] [blame] | 138 | #if (_MSC_VER >= 1600) |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 139 | # define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 140 | # define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR |
Phil Nash | 43470b2 | 2015-05-19 22:37:23 +0100 | [diff] [blame] | 141 | #endif |
| 142 | |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 143 | #if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015)) |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 144 | #define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT |
| 145 | #define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS |
Martin Hořeňovský | 6991549 | 2017-01-07 12:58:01 +0100 | [diff] [blame] | 146 | #define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE |
Martin Hořeňovský | 60a9ac7 | 2017-01-26 18:47:29 +0100 | [diff] [blame] | 147 | #define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 148 | #endif |
| 149 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 150 | #endif // _MSC_VER |
| 151 | |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 152 | //////////////////////////////////////////////////////////////////////////////// |
| 153 | |
Phil Nash | 4dd3f68 | 2013-04-22 08:19:17 +0100 | [diff] [blame] | 154 | // Use variadic macros if the compiler supports them |
| 155 | #if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ |
| 156 | ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ |
| 157 | ( defined __GNUC__ && __GNUC__ >= 3 ) || \ |
| 158 | ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) |
Phil Nash | 597ed1f | 2013-05-14 19:31:21 +0100 | [diff] [blame] | 159 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 160 | #define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS |
Phil Nash | 597ed1f | 2013-05-14 19:31:21 +0100 | [diff] [blame] | 161 | |
Phil Nash | 4dd3f68 | 2013-04-22 08:19:17 +0100 | [diff] [blame] | 162 | #endif |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 163 | |
Phil Nash | 13a887a | 2015-12-15 07:50:51 +0000 | [diff] [blame] | 164 | // Use __COUNTER__ if the compiler supports it |
| 165 | #if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \ |
| 166 | ( defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 ) || \ |
| 167 | ( defined __clang__ && __clang_major__ >= 3 ) |
| 168 | |
| 169 | #define CATCH_INTERNAL_CONFIG_COUNTER |
| 170 | |
| 171 | #endif |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 172 | |
gnzlbg | ce65985 | 2014-03-20 12:48:19 +0100 | [diff] [blame] | 173 | //////////////////////////////////////////////////////////////////////////////// |
| 174 | // C++ language feature support |
| 175 | |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 176 | // catch all support for C++11 |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 177 | #if defined(CATCH_CPP11_OR_GREATER) |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 178 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 179 | # if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) |
| 180 | # define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 181 | # endif |
| 182 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 183 | # ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT |
| 184 | # define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 185 | # endif |
| 186 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 187 | # ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS |
| 188 | # define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 189 | # endif |
| 190 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 191 | # ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM |
| 192 | # define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 193 | # endif |
| 194 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 195 | # ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE |
| 196 | # define CATCH_INTERNAL_CONFIG_CPP11_TUPLE |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 197 | # endif |
| 198 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 199 | # ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS |
| 200 | # define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 201 | # endif |
| 202 | |
Phil Nash | 733ebb6 | 2015-07-23 19:03:33 +0100 | [diff] [blame] | 203 | # if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) |
| 204 | # define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG |
| 205 | # endif |
| 206 | |
Phil Nash | 4cb7476 | 2015-08-05 19:02:17 +0100 | [diff] [blame] | 207 | # if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) |
| 208 | # define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE |
| 209 | # endif |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 210 | # if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) |
| 211 | # define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR |
| 212 | # endif |
Martin Hořeňovský | 6991549 | 2017-01-07 12:58:01 +0100 | [diff] [blame] | 213 | # if !defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) |
| 214 | # define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE |
| 215 | # endif |
Martin Hořeňovský | 60a9ac7 | 2017-01-26 18:47:29 +0100 | [diff] [blame] | 216 | # if !defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) |
| 217 | # define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS |
| 218 | # endif |
Phil Nash | 4cb7476 | 2015-08-05 19:02:17 +0100 | [diff] [blame] | 219 | |
Phil Nash | e86daf8 | 2015-05-19 18:37:58 +0100 | [diff] [blame] | 220 | #endif // __cplusplus >= 201103L |
gnzlbg | ce65985 | 2014-03-20 12:48:19 +0100 | [diff] [blame] | 221 | |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 222 | // Now set the actual defines based on the above + anything the user has configured |
| 223 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11) |
| 224 | # define CATCH_CONFIG_CPP11_NULLPTR |
| 225 | #endif |
| 226 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11) |
| 227 | # define CATCH_CONFIG_CPP11_NOEXCEPT |
| 228 | #endif |
| 229 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11) |
| 230 | # define CATCH_CONFIG_CPP11_GENERATED_METHODS |
| 231 | #endif |
| 232 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11) |
| 233 | # define CATCH_CONFIG_CPP11_IS_ENUM |
| 234 | #endif |
| 235 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11) |
| 236 | # define CATCH_CONFIG_CPP11_TUPLE |
| 237 | #endif |
| 238 | #if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS) |
Phil Nash | 733ebb6 | 2015-07-23 19:03:33 +0100 | [diff] [blame] | 239 | # define CATCH_CONFIG_VARIADIC_MACROS |
| 240 | #endif |
Martin Hořeňovský | a1bed57 | 2017-01-10 22:54:57 +0100 | [diff] [blame] | 241 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11) |
Phil Nash | 733ebb6 | 2015-07-23 19:03:33 +0100 | [diff] [blame] | 242 | # define CATCH_CONFIG_CPP11_LONG_LONG |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 243 | #endif |
Martin Hořeňovský | a1bed57 | 2017-01-10 22:54:57 +0100 | [diff] [blame] | 244 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11) |
Phil Nash | 4cb7476 | 2015-08-05 19:02:17 +0100 | [diff] [blame] | 245 | # define CATCH_CONFIG_CPP11_OVERRIDE |
| 246 | #endif |
Martin Hořeňovský | a1bed57 | 2017-01-10 22:54:57 +0100 | [diff] [blame] | 247 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11) |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 248 | # define CATCH_CONFIG_CPP11_UNIQUE_PTR |
| 249 | #endif |
Phil Nash | 750b52b | 2017-01-14 21:00:51 +0000 | [diff] [blame] | 250 | // Use of __COUNTER__ is suppressed if __JETBRAINS_IDE__ is #defined (meaning we're being parsed by a JetBrains IDE for |
| 251 | // analytics) because, at time of writing, __COUNTER__ is not properly handled by it. |
| 252 | // This does not affect compilation |
| 253 | #if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) && !defined(__JETBRAINS_IDE__) |
Phil Nash | 13a887a | 2015-12-15 07:50:51 +0000 | [diff] [blame] | 254 | # define CATCH_CONFIG_COUNTER |
| 255 | #endif |
Martin Hořeňovský | a1bed57 | 2017-01-10 22:54:57 +0100 | [diff] [blame] | 256 | #if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11) |
Martin Hořeňovský | 6991549 | 2017-01-07 12:58:01 +0100 | [diff] [blame] | 257 | # define CATCH_CONFIG_CPP11_SHUFFLE |
| 258 | #endif |
Martin Hořeňovský | 60a9ac7 | 2017-01-26 18:47:29 +0100 | [diff] [blame] | 259 | # if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11) |
| 260 | # define CATCH_CONFIG_CPP11_TYPE_TRAITS |
| 261 | # endif |
Martin Hořeňovský | e991c00 | 2017-02-06 01:43:53 +0100 | [diff] [blame] | 262 | #if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) |
| 263 | # define CATCH_CONFIG_WINDOWS_SEH |
| 264 | #endif |
Martin Hořeňovský | c617860 | 2017-02-15 17:57:22 +0100 | [diff] [blame] | 265 | // This is set by default, because we assume that unix compilers are posix-signal-compatible by default. |
Martin Hořeňovský | c3a41e2 | 2017-03-29 20:30:59 +0200 | [diff] [blame] | 266 | #if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) |
Martin Hořeňovský | c617860 | 2017-02-15 17:57:22 +0100 | [diff] [blame] | 267 | # define CATCH_CONFIG_POSIX_SIGNALS |
| 268 | #endif |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 269 | |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 270 | #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) |
| 271 | # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS |
Phil Nash | fe690a6 | 2017-02-15 09:38:38 +0000 | [diff] [blame] | 272 | # define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS |
Phil Nash | 91bfe68 | 2016-02-29 08:01:06 +0000 | [diff] [blame] | 273 | #endif |
Martin Hořeňovský | c3a41e2 | 2017-03-29 20:30:59 +0200 | [diff] [blame] | 274 | #if !defined(CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS) |
| 275 | # define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS |
| 276 | # define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS |
| 277 | #endif |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 278 | |
gnzlbg | ce65985 | 2014-03-20 12:48:19 +0100 | [diff] [blame] | 279 | // noexcept support: |
Phil Nash | 1a6f2a0 | 2014-04-23 18:19:19 +0100 | [diff] [blame] | 280 | #if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT) |
| 281 | # define CATCH_NOEXCEPT noexcept |
| 282 | # define CATCH_NOEXCEPT_IS(x) noexcept(x) |
| 283 | #else |
gnzlbg | ce65985 | 2014-03-20 12:48:19 +0100 | [diff] [blame] | 284 | # define CATCH_NOEXCEPT throw() |
| 285 | # define CATCH_NOEXCEPT_IS(x) |
| 286 | #endif |
| 287 | |
Phil Nash | 805de43 | 2015-07-01 07:33:27 +0100 | [diff] [blame] | 288 | // nullptr support |
| 289 | #ifdef CATCH_CONFIG_CPP11_NULLPTR |
| 290 | # define CATCH_NULL nullptr |
| 291 | #else |
| 292 | # define CATCH_NULL NULL |
| 293 | #endif |
Phil Nash | 7ab3b5a | 2015-06-30 08:41:55 +0100 | [diff] [blame] | 294 | |
Phil Nash | 4cb7476 | 2015-08-05 19:02:17 +0100 | [diff] [blame] | 295 | // override support |
| 296 | #ifdef CATCH_CONFIG_CPP11_OVERRIDE |
| 297 | # define CATCH_OVERRIDE override |
| 298 | #else |
| 299 | # define CATCH_OVERRIDE |
| 300 | #endif |
| 301 | |
Phil Nash | 40d0d2f | 2015-08-11 08:09:41 +0100 | [diff] [blame] | 302 | // unique_ptr support |
| 303 | #ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR |
| 304 | # define CATCH_AUTO_PTR( T ) std::unique_ptr<T> |
| 305 | #else |
| 306 | # define CATCH_AUTO_PTR( T ) std::auto_ptr<T> |
| 307 | #endif |
| 308 | |
Phil Nash | 5062d3e | 2013-04-16 22:55:31 +0100 | [diff] [blame] | 309 | #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED |
| 310 | |