diff --git a/include/fmt/color.h b/include/fmt/color.h index 68c0f16a..df912fe2 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -189,7 +189,7 @@ enum class color : uint32_t { white = 0xFFFFFF, // rgb(255,255,255) white_smoke = 0xF5F5F5, // rgb(245,245,245) yellow = 0xFFFF00, // rgb(255,255,0) - yellow_green = 0x9ACD32, // rgb(154,205,50) + yellow_green = 0x9ACD32 // rgb(154,205,50) }; // enum class color // rgb is a struct for red, green and blue colors. diff --git a/include/fmt/core.h b/include/fmt/core.h index 3c522403..f24d5c5f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -91,8 +91,10 @@ #if FMT_HAS_FEATURE(cxx_explicit_conversions) || \ FMT_GCC_VERSION >= 405 || FMT_MSC_VER >= 1800 +# define FMT_USE_EXPLICIT 1 # define FMT_EXPLICIT explicit #else +# define FMT_USE_EXPLICIT 0 # define FMT_EXPLICIT #endif @@ -658,7 +660,12 @@ FMT_MAKE_VALUE_SAME(long_long_type, long long) FMT_MAKE_VALUE_SAME(ulong_long_type, unsigned long long) FMT_MAKE_VALUE(int_type, signed char, int) FMT_MAKE_VALUE(uint_type, unsigned char, unsigned) -FMT_MAKE_VALUE(char_type, typename C::char_type, int) + +// This doesn't use FMT_MAKE_VALUE because of ambiguity in gcc 4.4. +template +FMT_CONSTEXPR typename std::enable_if< + std::is_same::value, + init>::type make_value(Char val) { return val; } template FMT_CONSTEXPR typename std::enable_if< @@ -718,7 +725,7 @@ inline typename std::enable_if< template inline typename std::enable_if< - !convert_to_int::value && + !convert_to_int::value && !std::is_same::value && !std::is_convertible>::value && !internal::is_constructible, T>::value && !internal::has_to_string_view::value, diff --git a/include/fmt/format.h b/include/fmt/format.h index 428e4a29..0d925440 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1725,7 +1725,7 @@ FMT_CONSTEXPR void set_dynamic_spec( T &value, basic_format_arg arg, ErrorHandler eh) { unsigned long long big_value = visit_format_arg(Handler(eh), arg); - if (big_value > (std::numeric_limits::max)()) + if (big_value > to_unsigned((std::numeric_limits::max)())) eh.on_error("number is too big"); value = static_cast(big_value); } @@ -2111,7 +2111,7 @@ FMT_CONSTEXPR void parse_format_string( ++p; if (p == end) return handler.on_error("invalid format string"); - if (*p == '}') { + if (static_cast(*p) == '}') { handler.on_arg_id(); handler.on_replacement_field(p); } else if (*p == '{') { diff --git a/test/core-test.cc b/test/core-test.cc index 245c1768..77d35428 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -65,6 +65,7 @@ struct formatter { }; FMT_END_NAMESPACE +#if !FMT_GCC_VERSION || FMT_GCC_VERSION >= 470 TEST(BufferTest, Noncopyable) { EXPECT_FALSE(std::is_copy_constructible >::value); #if !FMT_MSC_VER @@ -80,11 +81,12 @@ TEST(BufferTest, Nonmoveable) { EXPECT_FALSE(std::is_move_assignable >::value); #endif } +#endif // A test buffer with a dummy grow method. template struct test_buffer : basic_buffer { - void grow(std::size_t capacity) { this->set(nullptr, capacity); } + void grow(std::size_t capacity) { this->set(FMT_NULL, capacity); } }; template @@ -104,7 +106,7 @@ struct mock_buffer : basic_buffer { TEST(BufferTest, Ctor) { { mock_buffer buffer; - EXPECT_EQ(nullptr, &buffer[0]); + EXPECT_EQ(FMT_NULL, &buffer[0]); EXPECT_EQ(static_cast(0), buffer.size()); EXPECT_EQ(static_cast(0), buffer.capacity()); } @@ -219,7 +221,7 @@ struct custom_context { const char *format(const T &, custom_context& ctx) { ctx.called = true; - return nullptr; + return FMT_NULL; } }; }; @@ -365,8 +367,8 @@ TEST(ArgTest, WStringArg) { } TEST(ArgTest, PointerArg) { - void *p = nullptr; - const void *cp = nullptr; + void *p = FMT_NULL; + const void *cp = FMT_NULL; CHECK_ARG_(char, cp, p); CHECK_ARG_(wchar_t, cp, p); CHECK_ARG(cp, ); @@ -377,7 +379,7 @@ struct check_custom { fmt::basic_format_arg::handle h) const { struct test_buffer : fmt::internal::basic_buffer { char data[10]; - test_buffer() : basic_buffer(data, 0, 10) {} + test_buffer() : fmt::internal::basic_buffer(data, 0, 10) {} void grow(std::size_t) {} } buffer; fmt::internal::basic_buffer &base = buffer; diff --git a/test/format-impl-test.cc b/test/format-impl-test.cc index 63b6c405..1f584e06 100644 --- a/test/format-impl-test.cc +++ b/test/format-impl-test.cc @@ -136,9 +136,9 @@ TEST(FormatTest, FormatNegativeNaN) { } TEST(FormatTest, StrError) { - char *message = nullptr; + char *message = FMT_NULL; char buffer[BUFFER_SIZE]; - EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = nullptr, 0), + EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = FMT_NULL, 0), "invalid buffer"); EXPECT_ASSERT(fmt::safe_strerror(EDOM, message = buffer, 0), "invalid buffer"); diff --git a/test/format-test.cc b/test/format-test.cc index 2f227bf0..a30da8e9 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -212,7 +212,7 @@ TEST(AllocatorTest, allocator_ref) { test_allocator_ref ref2(ref); check_forwarding(alloc, ref2); test_allocator_ref ref3; - EXPECT_EQ(nullptr, ref3.get()); + EXPECT_EQ(FMT_NULL, ref3.get()); ref3 = ref; check_forwarding(alloc, ref3); } @@ -228,7 +228,7 @@ static void check_move_buffer(const char *str, EXPECT_EQ(str, std::string(&buffer2[0], buffer2.size())); EXPECT_EQ(5u, buffer2.capacity()); // Move should transfer allocator. - EXPECT_EQ(nullptr, buffer.get_allocator().get()); + EXPECT_EQ(FMT_NULL, buffer.get_allocator().get()); EXPECT_EQ(alloc, buffer2.get_allocator().get()); } @@ -313,7 +313,7 @@ TEST(MemoryBufferTest, Grow) { TEST(MemoryBufferTest, Allocator) { typedef allocator_ref< mock_allocator > TestAllocator; basic_memory_buffer buffer; - EXPECT_EQ(nullptr, buffer.get_allocator().get()); + EXPECT_EQ(FMT_NULL, buffer.get_allocator().get()); StrictMock< mock_allocator > alloc; char mem; { @@ -453,7 +453,7 @@ TEST(UtilTest, FormatSystemError) { fmt::print("warning: std::allocator allocates {} chars", max_size); return; } - fmt::format_system_error(message, EDOM, fmt::string_view(nullptr, max_size)); + fmt::format_system_error(message, EDOM, fmt::string_view(FMT_NULL, max_size)); EXPECT_EQ(fmt::format("error {}", EDOM), to_string(message)); } @@ -1489,7 +1489,7 @@ TEST(FormatterTest, FormatCString) { EXPECT_EQ("test", format("{0:s}", "test")); char nonconst[] = "nonconst"; EXPECT_EQ("nonconst", format("{0}", nonconst)); - EXPECT_THROW_MSG(format("{0}", static_cast(nullptr)), + EXPECT_THROW_MSG(format("{0}", static_cast(FMT_NULL)), format_error, "string pointer is null"); } @@ -1511,7 +1511,7 @@ TEST(FormatterTest, FormatUCharString) { TEST(FormatterTest, FormatPointer) { check_unknown_types(reinterpret_cast(0x1234), "p", "pointer"); - EXPECT_EQ("0x0", format("{0}", static_cast(nullptr))); + EXPECT_EQ("0x0", format("{0}", static_cast(FMT_NULL))); EXPECT_EQ("0x1234", format("{0}", reinterpret_cast(0x1234))); EXPECT_EQ("0x1234", format("{0:p}", reinterpret_cast(0x1234))); EXPECT_EQ("0x" + std::string(sizeof(void*) * CHAR_BIT / 4, 'f'), @@ -1546,7 +1546,7 @@ TEST(FormatterTest, FormatImplicitlyConvertibleToStringView) { } // std::is_constructible is broken in MSVC until version 2015. -#if !FMT_MSC_VER || FMT_MSC_VER >= 1900 +#if FMT_USE_EXPLICIT && (!FMT_MSC_VER || FMT_MSC_VER >= 1900) struct explicitly_convertible_to_string_view { explicit operator fmt::string_view() const { return "foo"; } }; @@ -1652,7 +1652,7 @@ TEST(FormatterTest, FormatExamples) { FILE *ftest = safe_fopen(filename, "r"); if (ftest) fclose(ftest); int error_code = errno; - EXPECT_TRUE(ftest == nullptr); + EXPECT_TRUE(ftest == FMT_NULL); EXPECT_SYSTEM_ERROR({ FILE *f = safe_fopen(filename, "r"); if (!f) @@ -1769,7 +1769,7 @@ TEST(FormatTest, Variadic) { } TEST(FormatTest, Dynamic) { - using ctx = fmt::format_context; + typedef fmt::format_context ctx; std::vector> args; args.emplace_back(fmt::internal::make_arg(42)); args.emplace_back(fmt::internal::make_arg("abc1")); @@ -2321,7 +2321,7 @@ FMT_CONSTEXPR bool equal(const char *s1, const char *s2) { template FMT_CONSTEXPR bool test_error(const char *fmt, const char *expected_error) { - const char *actual_error = nullptr; + const char *actual_error = FMT_NULL; fmt::internal::check_format_string( string_view(fmt, len(fmt)), test_error_handler(actual_error)); return equal(actual_error, expected_error); @@ -2333,7 +2333,7 @@ FMT_CONSTEXPR bool test_error(const char *fmt, const char *expected_error) { static_assert(test_error<__VA_ARGS__>(fmt, error), "") TEST(FormatTest, FormatStringErrors) { - EXPECT_ERROR_NOARGS("foo", nullptr); + EXPECT_ERROR_NOARGS("foo", FMT_NULL); EXPECT_ERROR_NOARGS("}", "unmatched '}' in format string"); EXPECT_ERROR("{0:s", "unknown format specifier", Date); #ifndef _MSC_VER diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index 13596b18..97abf539 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -340,10 +340,10 @@ TEST(OutputRedirectTest, FlushErrorInCtor) { // Put a character in a file buffer. EXPECT_EQ('x', fputc('x', f.get())); FMT_POSIX(close(write_fd)); - scoped_ptr redir{nullptr}; + scoped_ptr redir{FMT_NULL}; EXPECT_SYSTEM_ERROR_NOASSERT(redir.reset(new OutputRedirect(f.get())), EBADF, "cannot flush stream"); - redir.reset(nullptr); + redir.reset(FMT_NULL); write_copy.dup2(write_fd); // "undo" close or dtor will fail } @@ -352,7 +352,7 @@ TEST(OutputRedirectTest, DupErrorInCtor) { int fd = (f.fileno)(); file copy = file::dup(fd); FMT_POSIX(close(fd)); - scoped_ptr redir{nullptr}; + scoped_ptr redir{FMT_NULL}; EXPECT_SYSTEM_ERROR_NOASSERT(redir.reset(new OutputRedirect(f.get())), EBADF, fmt::format("cannot duplicate file descriptor {}", fd)); copy.dup2(fd); // "undo" close or dtor will fail @@ -403,7 +403,7 @@ TEST(OutputRedirectTest, ErrorInDtor) { // output in EXPECT_STDERR and the second close will break output // redirection. FMT_POSIX(close(write_fd)); - SUPPRESS_ASSERT(redir.reset(nullptr)); + SUPPRESS_ASSERT(redir.reset(FMT_NULL)); }, format_system_error(EBADF, "cannot flush stream")); write_copy.dup2(write_fd); // "undo" close or dtor of buffered_file will fail } diff --git a/test/gtest-extra.h b/test/gtest-extra.h index c3728f53..61e262e4 100644 --- a/test/gtest-extra.h +++ b/test/gtest-extra.h @@ -155,7 +155,7 @@ std::string read(fmt::file &f, std::size_t count); template struct ScopedMock : testing::StrictMock { ScopedMock() { Mock::instance = this; } - ~ScopedMock() { Mock::instance = nullptr; } + ~ScopedMock() { Mock::instance = FMT_NULL; } }; #endif // FMT_GTEST_EXTRA_H_ diff --git a/test/mock-allocator.h b/test/mock-allocator.h index 87769690..65ee6ab8 100644 --- a/test/mock-allocator.h +++ b/test/mock-allocator.h @@ -28,13 +28,13 @@ class allocator_ref { void move(allocator_ref &other) { alloc_ = other.alloc_; - other.alloc_ = nullptr; + other.alloc_ = FMT_NULL; } public: typedef typename Allocator::value_type value_type; - explicit allocator_ref(Allocator *alloc = nullptr) : alloc_(alloc) {} + explicit allocator_ref(Allocator *alloc = FMT_NULL) : alloc_(alloc) {} allocator_ref(const allocator_ref &other) : alloc_(other.alloc_) {} allocator_ref(allocator_ref &&other) { move(other); } diff --git a/test/ostream-test.cc b/test/ostream-test.cc index 50b8e4e8..76db8b3a 100644 --- a/test/ostream-test.cc +++ b/test/ostream-test.cc @@ -146,7 +146,7 @@ TEST(OStreamTest, WriteToOStreamMaxSize) { } os(streambuf); testing::InSequence sequence; - const char *data = nullptr; + const char *data = FMT_NULL; std::size_t size = max_size; do { typedef std::make_unsigned::type ustreamsize; diff --git a/test/posix-mock-test.cc b/test/posix-mock-test.cc index 83a9ac3c..8b0e14e1 100644 --- a/test/posix-mock-test.cc +++ b/test/posix-mock-test.cc @@ -133,7 +133,7 @@ int test::dup2(int fildes, int fildes2) { } FILE *test::fdopen(int fildes, const char *mode) { - EMULATE_EINTR(fdopen, nullptr); + EMULATE_EINTR(fdopen, FMT_NULL); return ::FMT_POSIX(fdopen(fildes, mode)); } @@ -162,7 +162,7 @@ int test::pipe(int *pfds, unsigned psize, int textmode) { #endif FILE *test::fopen(const char *filename, const char *mode) { - EMULATE_EINTR(fopen, nullptr); + EMULATE_EINTR(fopen, FMT_NULL); return ::fopen(filename, mode); } @@ -216,7 +216,7 @@ TEST(UtilTest, GetPageSize) { TEST(FileTest, OpenRetry) { write_file("test", "there must be something here"); - scoped_ptr f{nullptr}; + scoped_ptr f{FMT_NULL}; EXPECT_RETRY(f.reset(new file("test", file::RDONLY)), open, "cannot open file test"); #ifndef _WIN32 @@ -232,7 +232,7 @@ TEST(FileTest, CloseNoRetryInDtor) { int saved_close_count = 0; EXPECT_WRITE(stderr, { close_count = 1; - f.reset(nullptr); + f.reset(FMT_NULL); saved_close_count = close_count; close_count = 0; }, format_system_error(EINTR, "cannot close file") + "\n"); @@ -385,7 +385,7 @@ TEST(FileTest, FdopenNoRetry) { TEST(BufferedFileTest, OpenRetry) { write_file("test", "there must be something here"); - scoped_ptr f{nullptr}; + scoped_ptr f{FMT_NULL}; EXPECT_RETRY(f.reset(new buffered_file("test", "r")), fopen, "cannot open file test"); #ifndef _WIN32 @@ -402,7 +402,7 @@ TEST(BufferedFileTest, CloseNoRetryInDtor) { int saved_fclose_count = 0; EXPECT_WRITE(stderr, { fclose_count = 1; - f.reset(nullptr); + f.reset(FMT_NULL); saved_fclose_count = fclose_count; fclose_count = 0; }, format_system_error(EINTR, "cannot close file") + "\n"); @@ -440,7 +440,7 @@ TEST(ScopedMock, Scope) { TestMock © = mock; static_cast(copy); } - EXPECT_EQ(nullptr, TestMock::instance); + EXPECT_EQ(FMT_NULL, TestMock::instance); } #ifdef FMT_LOCALE @@ -515,7 +515,7 @@ TEST(LocaleTest, Locale) { #endif ScopedMock mock; LocaleType impl = reinterpret_cast(42); - EXPECT_CALL(mock, newlocale(LC_NUMERIC_MASK, StrEq("C"), nullptr)) + EXPECT_CALL(mock, newlocale(LC_NUMERIC_MASK, StrEq("C"), FMT_NULL)) .WillOnce(Return(impl)); EXPECT_CALL(mock, freelocale(impl)); fmt::Locale locale; diff --git a/test/posix-test.cc b/test/posix-test.cc index f23d06b3..4209b241 100644 --- a/test/posix-test.cc +++ b/test/posix-test.cc @@ -59,26 +59,26 @@ static void write(file &f, fmt::string_view s) { TEST(BufferedFileTest, DefaultCtor) { buffered_file f; - EXPECT_TRUE(f.get() == nullptr); + EXPECT_TRUE(f.get() == FMT_NULL); } TEST(BufferedFileTest, MoveCtor) { buffered_file bf = open_buffered_file(); FILE *fp = bf.get(); - EXPECT_TRUE(fp != nullptr); + EXPECT_TRUE(fp != FMT_NULL); buffered_file bf2(std::move(bf)); EXPECT_EQ(fp, bf2.get()); - EXPECT_TRUE(bf.get() == nullptr); + EXPECT_TRUE(bf.get() == FMT_NULL); } TEST(BufferedFileTest, MoveAssignment) { buffered_file bf = open_buffered_file(); FILE *fp = bf.get(); - EXPECT_TRUE(fp != nullptr); + EXPECT_TRUE(fp != FMT_NULL); buffered_file bf2; bf2 = std::move(bf); EXPECT_EQ(fp, bf2.get()); - EXPECT_TRUE(bf.get() == nullptr); + EXPECT_TRUE(bf.get() == FMT_NULL); } TEST(BufferedFileTest, MoveAssignmentClosesFile) { @@ -90,13 +90,13 @@ TEST(BufferedFileTest, MoveAssignmentClosesFile) { } TEST(BufferedFileTest, MoveFromTemporaryInCtor) { - FILE *fp = nullptr; + FILE *fp = FMT_NULL; buffered_file f(open_buffered_file(&fp)); EXPECT_EQ(fp, f.get()); } TEST(BufferedFileTest, MoveFromTemporaryInAssignment) { - FILE *fp = nullptr; + FILE *fp = FMT_NULL; buffered_file f; f = open_buffered_file(&fp); EXPECT_EQ(fp, f.get()); @@ -126,7 +126,7 @@ TEST(BufferedFileTest, CloseErrorInDtor) { // output in EXPECT_STDERR and the second close will break output // redirection. FMT_POSIX(close(f->fileno())); - SUPPRESS_ASSERT(f.reset(nullptr)); + SUPPRESS_ASSERT(f.reset(FMT_NULL)); }, format_system_error(EBADF, "cannot close file") + "\n"); } @@ -134,7 +134,7 @@ TEST(BufferedFileTest, Close) { buffered_file f = open_buffered_file(); int fd = f.fileno(); f.close(); - EXPECT_TRUE(f.get() == nullptr); + EXPECT_TRUE(f.get() == FMT_NULL); EXPECT_TRUE(isclosed(fd)); } @@ -142,7 +142,7 @@ TEST(BufferedFileTest, CloseError) { buffered_file f = open_buffered_file(); FMT_POSIX(close(f.fileno())); EXPECT_SYSTEM_ERROR_NOASSERT(f.close(), EBADF, "cannot close file"); - EXPECT_TRUE(f.get() == nullptr); + EXPECT_TRUE(f.get() == FMT_NULL); } TEST(BufferedFileTest, Fileno) { @@ -253,7 +253,7 @@ TEST(FileTest, CloseErrorInDtor) { // output in EXPECT_STDERR and the second close will break output // redirection. FMT_POSIX(close(f->descriptor())); - SUPPRESS_ASSERT(f.reset(nullptr)); + SUPPRESS_ASSERT(f.reset(FMT_NULL)); }, format_system_error(EBADF, "cannot close file") + "\n"); } diff --git a/test/printf-test.cc b/test/printf-test.cc index f9208c16..22b28aca 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -426,11 +426,11 @@ TEST(PrintfTest, Char) { TEST(PrintfTest, String) { EXPECT_PRINTF("abc", "%s", "abc"); - const char *null_str = nullptr; + const char *null_str = FMT_NULL; EXPECT_PRINTF("(null)", "%s", null_str); EXPECT_PRINTF(" (null)", "%10s", null_str); EXPECT_PRINTF(L"abc", L"%s", L"abc"); - const wchar_t *null_wstr = nullptr; + const wchar_t *null_wstr = FMT_NULL; EXPECT_PRINTF(L"(null)", L"%s", null_wstr); EXPECT_PRINTF(L" (null)", L"%10s", null_wstr); } @@ -439,22 +439,22 @@ TEST(PrintfTest, Pointer) { int n; void *p = &n; EXPECT_PRINTF(fmt::format("{}", p), "%p", p); - p = nullptr; + p = FMT_NULL; EXPECT_PRINTF("(nil)", "%p", p); EXPECT_PRINTF(" (nil)", "%10p", p); const char *s = "test"; EXPECT_PRINTF(fmt::format("{:p}", s), "%p", s); - const char *null_str = nullptr; + const char *null_str = FMT_NULL; EXPECT_PRINTF("(nil)", "%p", null_str); p = &n; EXPECT_PRINTF(fmt::format(L"{}", p), L"%p", p); - p = nullptr; + p = FMT_NULL; EXPECT_PRINTF(L"(nil)", L"%p", p); EXPECT_PRINTF(L" (nil)", L"%10p", p); const wchar_t *w = L"test"; EXPECT_PRINTF(fmt::format(L"{:p}", w), L"%p", w); - const wchar_t *null_wstr = nullptr; + const wchar_t *null_wstr = FMT_NULL; EXPECT_PRINTF(L"(nil)", L"%p", null_wstr); } diff --git a/test/ranges-test.cc b/test/ranges-test.cc index 3f02cbf5..77b4ced5 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -9,12 +9,11 @@ // All Rights Reserved // {fmt} support for ranges, containers and types tuple interface. -#include "fmt/ranges.h" - /// Check if 'if constexpr' is supported. #if (__cplusplus > 201402L) || \ (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) +#include "fmt/ranges.h" #include "gtest.h" #include diff --git a/test/time-test.cc b/test/time-test.cc index bc05f24c..30957404 100644 --- a/test/time-test.cc +++ b/test/time-test.cc @@ -26,7 +26,7 @@ TEST(TimeTest, GrowBuffer) { for (int i = 0; i < 30; ++i) s += "%c"; s += "}\n"; - std::time_t t = std::time(nullptr); + std::time_t t = std::time(FMT_NULL); fmt::format(s, *std::localtime(&t)); } @@ -47,13 +47,13 @@ static bool EqualTime(const std::tm &lhs, const std::tm &rhs) { } TEST(TimeTest, LocalTime) { - std::time_t t = std::time(nullptr); + std::time_t t = std::time(FMT_NULL); std::tm tm = *std::localtime(&t); EXPECT_TRUE(EqualTime(tm, fmt::localtime(t))); } TEST(TimeTest, GMTime) { - std::time_t t = std::time(nullptr); + std::time_t t = std::time(FMT_NULL); std::tm tm = *std::gmtime(&t); EXPECT_TRUE(EqualTime(tm, fmt::gmtime(t))); } diff --git a/test/util.h b/test/util.h index c0af03c7..2b068d95 100644 --- a/test/util.h +++ b/test/util.h @@ -35,7 +35,7 @@ std::string get_system_error(int error_code); extern const char *const FILE_CONTENT; // Opens a buffered file for reading. -fmt::buffered_file open_buffered_file(FILE **fp = nullptr); +fmt::buffered_file open_buffered_file(FILE **fp = FMT_NULL); inline FILE *safe_fopen(const char *filename, const char *mode) { #if defined(_WIN32) && !defined(__MINGW32__)