Replace __cplusplus with FMT_CPLUSPLUS.

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
Vladislav Shchapov
2022-07-03 14:50:21 +05:00
committed by Victor Zverovich
parent 94114b05ca
commit 115e00e0b9
6 changed files with 20 additions and 20 deletions

View File

@@ -11,7 +11,7 @@
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806 && \
defined(__cpp_constexpr) && __cpp_constexpr >= 201907 && \
defined(__cpp_constexpr_dynamic_alloc) && \
__cpp_constexpr_dynamic_alloc >= 201907 && __cplusplus >= 202002L
__cpp_constexpr_dynamic_alloc >= 201907 && FMT_CPLUSPLUS >= 202002L
template <size_t max_string_length, typename Char = char> struct test_string {
template <typename T> constexpr bool operator==(const T& rhs) const noexcept {
return fmt::basic_string_view<Char>(rhs).compare(buffer) == 0;

View File

@@ -294,8 +294,8 @@ TEST(compile_test, compile_format_string_literal) {
}
#endif
#if __cplusplus >= 202002L || \
(__cplusplus >= 201709L && FMT_GCC_VERSION >= 1002)
#if FMT_CPLUSPLUS >= 202002L || \
(FMT_CPLUSPLUS >= 201709L && FMT_GCC_VERSION >= 1002)
template <size_t max_string_length, typename Char = char> struct test_string {
template <typename T> constexpr bool operator==(const T& rhs) const noexcept {
return fmt::basic_string_view<Char>(rhs).compare(buffer) == 0;

View File

@@ -1860,11 +1860,11 @@ TEST(format_test, compile_time_string) {
(void)with_null;
(void)no_null;
#if __cplusplus >= 201703L
#if FMT_CPLUSPLUS >= 201703L
EXPECT_EQ("42", fmt::format(FMT_STRING(with_null), 42));
EXPECT_EQ("42", fmt::format(FMT_STRING(no_null), 42));
#endif
#if defined(FMT_USE_STRING_VIEW) && __cplusplus >= 201703L
#if defined(FMT_USE_STRING_VIEW) && FMT_CPLUSPLUS >= 201703L
EXPECT_EQ("42", fmt::format(FMT_STRING(std::string_view("{}")), 42));
#endif
}
@@ -2233,7 +2233,7 @@ TEST(format_test, char_traits_is_not_ambiguous) {
using namespace std;
auto c = char_traits<char>::char_type();
(void)c;
#if __cplusplus >= 201103L
#if FMT_CPLUSPLUS >= 201103L
auto s = std::string();
auto lval = begin(s);
(void)lval;

View File

@@ -98,12 +98,12 @@ TEST(xchar_test, is_formattable) {
}
TEST(xchar_test, compile_time_string) {
#if defined(FMT_USE_STRING_VIEW) && __cplusplus >= 201703L
#if defined(FMT_USE_STRING_VIEW) && FMT_CPLUSPLUS >= 201703L
EXPECT_EQ(L"42", fmt::format(FMT_STRING(std::wstring_view(L"{}")), 42));
#endif
}
#if __cplusplus > 201103L
#if FMT_CPLUSPLUS > 201103L
struct custom_char {
int value;
custom_char() = default;