diff --git a/include/fmt/format.h b/include/fmt/format.h index cd10c49a..6740b613 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -226,8 +226,8 @@ FMT_END_NAMESPACE #endif // Enable the deprecated numeric alignment. -#ifndef FMT_NUMERIC_ALIGN -# define FMT_NUMERIC_ALIGN 1 +#ifndef FMT_DEPRECATED_NUMERIC_ALIGN +# define FMT_DEPRECATED_NUMERIC_ALIGN 1 #endif FMT_BEGIN_NAMESPACE @@ -2445,7 +2445,7 @@ FMT_CONSTEXPR const Char* parse_align(const Char* begin, const Char* end, case '>': align = align::right; break; -#if FMT_NUMERIC_ALIGN +#if FMT_DEPRECATED_NUMERIC_ALIGN case '=': align = align::numeric; break; diff --git a/test/format-test.cc b/test/format-test.cc index 22666eea..978feef2 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -605,7 +605,7 @@ TEST(FormatterTest, RightAlign) { EXPECT_EQ(" 0xface", format("{0:>8}", reinterpret_cast(0xface))); } -#if FMT_NUMERIC_ALIGN +#if FMT_DEPRECATED_NUMERIC_ALIGN TEST(FormatterTest, NumericAlign) { EXPECT_EQ("0042", format("{0:=4}", 42)); } #endif @@ -1887,7 +1887,7 @@ TEST(FormatTest, DynamicFormatter) { "cannot switch from manual to automatic argument indexing"); EXPECT_THROW_MSG(format("{:{0}}", num), format_error, "cannot switch from automatic to manual argument indexing"); -#if FMT_NUMERIC_ALIGN +#if FMT_DEPRECATED_NUMERIC_ALIGN EXPECT_THROW_MSG(format("{:=}", str), format_error, "format specifier requires numeric argument"); #endif @@ -2327,7 +2327,7 @@ TEST(FormatTest, FormatStringErrors) { EXPECT_ERROR("{:10000000000}", "number is too big", int); EXPECT_ERROR("{:.10000000000}", "number is too big", int); EXPECT_ERROR_NOARGS("{:x}", "argument not found"); -# if FMT_NUMERIC_ALIGN +# if FMT_DEPRECATED_NUMERIC_ALIGN EXPECT_ERROR("{0:=5", "unknown format specifier", int); EXPECT_ERROR("{:=}", "format specifier requires numeric argument", const char*); diff --git a/test/ostream-test.cc b/test/ostream-test.cc index 1e9d1896..e572cf19 100644 --- a/test/ostream-test.cc +++ b/test/ostream-test.cc @@ -96,7 +96,7 @@ TEST(OStreamTest, Format) { TEST(OStreamTest, FormatSpecs) { EXPECT_EQ("def ", format("{0:<5}", TestString("def"))); EXPECT_EQ(" def", format("{0:>5}", TestString("def"))); -#if FMT_NUMERIC_ALIGN +#if FMT_DEPRECATED_NUMERIC_ALIGN EXPECT_THROW_MSG(format("{0:=5}", TestString("def")), format_error, "format specifier requires numeric argument"); #endif