Rename None to Null because of conflict with an xlib.h macro
This commit is contained in:
parent
7859f81233
commit
c669cbedf8
12
format.cc
12
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;
|
||||
|
6
format.h
6
format.h
@ -833,20 +833,20 @@ template <typename Char>
|
||||
struct NamedArg;
|
||||
|
||||
template <typename T = void>
|
||||
struct None {};
|
||||
struct Null {};
|
||||
|
||||
// A helper class template to enable or disable overloads taking wide
|
||||
// characters and strings in MakeValue.
|
||||
template <typename T, typename Char>
|
||||
struct WCharHelper {
|
||||
typedef None<T> Supported;
|
||||
typedef Null<T> Supported;
|
||||
typedef T Unsupported;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct WCharHelper<T, wchar_t> {
|
||||
typedef T Supported;
|
||||
typedef None<T> Unsupported;
|
||||
typedef Null<T> Unsupported;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user