|
198 | 198 | // suppressed (constant conditional). |
199 | 199 | // GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127 |
200 | 200 | // is suppressed. |
201 | | -// GTEST_INTERNAL_HAS_ANY - for enabling UniversalPrinter<std::any> or |
202 | | -// UniversalPrinter<absl::any> specializations. |
203 | | -// Always defined to 0 or 1. |
204 | | -// GTEST_INTERNAL_HAS_OPTIONAL - for enabling UniversalPrinter<std::optional> |
205 | | -// or |
206 | | -// UniversalPrinter<absl::optional> |
207 | | -// specializations. Always defined to 0 or 1. |
208 | 201 | // GTEST_INTERNAL_HAS_STD_SPAN - for enabling UniversalPrinter<std::span> |
209 | 202 | // specializations. Always defined to 0 or 1 |
210 | | -// GTEST_INTERNAL_HAS_STRING_VIEW - for enabling Matcher<std::string_view> or |
211 | | -// Matcher<absl::string_view> |
212 | | -// specializations. Always defined to 0 or 1. |
213 | | -// GTEST_INTERNAL_HAS_VARIANT - for enabling UniversalPrinter<std::variant> or |
214 | | -// UniversalPrinter<absl::variant> |
215 | | -// specializations. Always defined to 0 or 1. |
216 | 203 | // GTEST_USE_OWN_FLAGFILE_FLAG_ - Always defined to 0 or 1. |
217 | 204 | // GTEST_HAS_CXXABI_H_ - Always defined to 0 or 1. |
218 | 205 | // GTEST_CAN_STREAM_RESULTS_ - Always defined to 0 or 1. |
@@ -2335,73 +2322,6 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val); |
2335 | 2322 | } // namespace internal |
2336 | 2323 | } // namespace testing |
2337 | 2324 |
|
2338 | | -#ifdef GTEST_HAS_ABSL |
2339 | | -// Always use absl::any for UniversalPrinter<> specializations if googletest |
2340 | | -// is built with absl support. |
2341 | | -#define GTEST_INTERNAL_HAS_ANY 1 |
2342 | | -#include "absl/types/any.h" |
2343 | | -namespace testing { |
2344 | | -namespace internal { |
2345 | | -using Any = ::absl::any; |
2346 | | -} // namespace internal |
2347 | | -} // namespace testing |
2348 | | -#else |
2349 | | -#if defined(__cpp_lib_any) || (GTEST_INTERNAL_HAS_INCLUDE(<any>) && \ |
2350 | | - GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \ |
2351 | | - (!defined(_MSC_VER) || GTEST_HAS_RTTI)) |
2352 | | -// Otherwise for C++17 and higher use std::any for UniversalPrinter<> |
2353 | | -// specializations. |
2354 | | -#define GTEST_INTERNAL_HAS_ANY 1 |
2355 | | -#include <any> |
2356 | | -namespace testing { |
2357 | | -namespace internal { |
2358 | | -using Any = ::std::any; |
2359 | | -} // namespace internal |
2360 | | -} // namespace testing |
2361 | | -// The case where absl is configured NOT to alias std::any is not |
2362 | | -// supported. |
2363 | | -#endif // __cpp_lib_any |
2364 | | -#endif // GTEST_HAS_ABSL |
2365 | | - |
2366 | | -#ifndef GTEST_INTERNAL_HAS_ANY |
2367 | | -#define GTEST_INTERNAL_HAS_ANY 0 |
2368 | | -#endif |
2369 | | - |
2370 | | -#ifdef GTEST_HAS_ABSL |
2371 | | -// Always use absl::optional for UniversalPrinter<> specializations if |
2372 | | -// googletest is built with absl support. |
2373 | | -#define GTEST_INTERNAL_HAS_OPTIONAL 1 |
2374 | | -#include "absl/types/optional.h" |
2375 | | -namespace testing { |
2376 | | -namespace internal { |
2377 | | -template <typename T> |
2378 | | -using Optional = ::absl::optional<T>; |
2379 | | -inline ::absl::nullopt_t Nullopt() { return ::absl::nullopt; } |
2380 | | -} // namespace internal |
2381 | | -} // namespace testing |
2382 | | -#else |
2383 | | -#if defined(__cpp_lib_optional) || (GTEST_INTERNAL_HAS_INCLUDE(<optional>) && \ |
2384 | | - GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L) |
2385 | | -// Otherwise for C++17 and higher use std::optional for UniversalPrinter<> |
2386 | | -// specializations. |
2387 | | -#define GTEST_INTERNAL_HAS_OPTIONAL 1 |
2388 | | -#include <optional> |
2389 | | -namespace testing { |
2390 | | -namespace internal { |
2391 | | -template <typename T> |
2392 | | -using Optional = ::std::optional<T>; |
2393 | | -inline ::std::nullopt_t Nullopt() { return ::std::nullopt; } |
2394 | | -} // namespace internal |
2395 | | -} // namespace testing |
2396 | | -// The case where absl is configured NOT to alias std::optional is not |
2397 | | -// supported. |
2398 | | -#endif // __cpp_lib_optional |
2399 | | -#endif // GTEST_HAS_ABSL |
2400 | | - |
2401 | | -#ifndef GTEST_INTERNAL_HAS_OPTIONAL |
2402 | | -#define GTEST_INTERNAL_HAS_OPTIONAL 0 |
2403 | | -#endif |
2404 | | - |
2405 | 2325 | #if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE(<span>) && \ |
2406 | 2326 | GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L) |
2407 | 2327 | #define GTEST_INTERNAL_HAS_STD_SPAN 1 |
@@ -2443,38 +2363,6 @@ using StringView = ::std::string_view; |
2443 | 2363 | #define GTEST_INTERNAL_HAS_STRING_VIEW 0 |
2444 | 2364 | #endif |
2445 | 2365 |
|
2446 | | -#ifdef GTEST_HAS_ABSL |
2447 | | -// Always use absl::variant for UniversalPrinter<> specializations if googletest |
2448 | | -// is built with absl support. |
2449 | | -#define GTEST_INTERNAL_HAS_VARIANT 1 |
2450 | | -#include "absl/types/variant.h" |
2451 | | -namespace testing { |
2452 | | -namespace internal { |
2453 | | -template <typename... T> |
2454 | | -using Variant = ::absl::variant<T...>; |
2455 | | -} // namespace internal |
2456 | | -} // namespace testing |
2457 | | -#else |
2458 | | -#if defined(__cpp_lib_variant) || (GTEST_INTERNAL_HAS_INCLUDE(<variant>) && \ |
2459 | | - GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L) |
2460 | | -// Otherwise for C++17 and higher use std::variant for UniversalPrinter<> |
2461 | | -// specializations. |
2462 | | -#define GTEST_INTERNAL_HAS_VARIANT 1 |
2463 | | -#include <variant> |
2464 | | -namespace testing { |
2465 | | -namespace internal { |
2466 | | -template <typename... T> |
2467 | | -using Variant = ::std::variant<T...>; |
2468 | | -} // namespace internal |
2469 | | -} // namespace testing |
2470 | | -// The case where absl is configured NOT to alias std::variant is not supported. |
2471 | | -#endif // __cpp_lib_variant |
2472 | | -#endif // GTEST_HAS_ABSL |
2473 | | - |
2474 | | -#ifndef GTEST_INTERNAL_HAS_VARIANT |
2475 | | -#define GTEST_INTERNAL_HAS_VARIANT 0 |
2476 | | -#endif |
2477 | | - |
2478 | 2366 | #if (defined(__cpp_lib_three_way_comparison) || \ |
2479 | 2367 | (GTEST_INTERNAL_HAS_INCLUDE(<compare>) && \ |
2480 | 2368 | GTEST_INTERNAL_CPLUSPLUS_LANG >= 201907L)) |
|
0 commit comments