diff --git a/format.cc b/format.cc index 86b86c74..d69042fa 100644 --- a/format.cc +++ b/format.cc @@ -95,11 +95,11 @@ using fmt::internal::Arg; // Dummy implementations of strerror_r and strerror_s called if corresponding // system functions are not available. -static inline fmt::internal::None<> strerror_r(int, char *, ...) { - return fmt::internal::None<>(); +static inline fmt::internal::Null<> strerror_r(int, char *, ...) { + return fmt::internal::Null<>(); } -static inline fmt::internal::None<> strerror_s(char *, std::size_t, ...) { - return fmt::internal::None<>(); +static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { + return fmt::internal::Null<>(); } namespace fmt { @@ -185,7 +185,7 @@ int safe_strerror( } // Handle the case when strerror_r is not available. - int handle(fmt::internal::None<>) { + int handle(fmt::internal::Null<>) { return fallback(strerror_s(buffer_, buffer_size_, error_code_)); } @@ -197,7 +197,7 @@ int safe_strerror( } // Fallback to strerror if strerror_r and strerror_s are not available. - int fallback(fmt::internal::None<>) { + int fallback(fmt::internal::Null<>) { errno = 0; buffer_ = strerror(error_code_); return errno; diff --git a/format.h b/format.h index dfe95a77..f56242fc 100644 --- a/format.h +++ b/format.h @@ -833,20 +833,20 @@ template struct NamedArg; template -struct None {}; +struct Null {}; // A helper class template to enable or disable overloads taking wide // characters and strings in MakeValue. template struct WCharHelper { - typedef None Supported; + typedef Null Supported; typedef T Unsupported; }; template struct WCharHelper { typedef T Supported; - typedef None Unsupported; + typedef Null Unsupported; }; template diff --git a/test/format-test.cc b/test/format-test.cc index 7af80251..31593833 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -42,6 +42,9 @@ #include "gmock/gmock.h" +// Test that the library compiles if None is defined to 0 as done by xlib.h. +#define None 0 + #include "format.h" #include "util.h" #include "mock-allocator.h"