fix: only use __cpp_lib_three_way_comparison for <compare> detection

The fallback check GTEST_INTERNAL_HAS_INCLUDE(<compare>) && C++20 causes build failures on Android NDK 24 which has the header but lacks the full comparison operators needed by PrintTo. The feature test macro __cpp_lib_three_way_comparison is the reliable indicator.

Fixes #4933
This commit is contained in:
Manikandan K. S. 2026-07-05 09:03:35 +05:30
parent 973323ed64
commit 18c6bc3dc4

View File

@ -2411,9 +2411,7 @@ using StringView = ::std::string_view;
#define GTEST_INTERNAL_HAS_STRING_VIEW 0
#endif
#if (defined(__cpp_lib_three_way_comparison) || \
(GTEST_INTERNAL_HAS_INCLUDE(<compare>) && \
GTEST_INTERNAL_CPLUSPLUS_LANG >= 201907L))
#if defined(__cpp_lib_three_way_comparison)
#define GTEST_INTERNAL_HAS_COMPARE_LIB 1
#else
#define GTEST_INTERNAL_HAS_COMPARE_LIB 0