refactor: use dummy function call instead of using #pragma
This commit is contained in:
parent
69c0a24af6
commit
05272b8e8e
@ -70,11 +70,6 @@
|
|||||||
# pragma warning(disable: 4996)
|
# pragma warning(disable: 4996)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __c2__
|
|
||||||
# pragma clang diagnostic push
|
|
||||||
# pragma clang diagnostic ignored "-Wunused-function"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Dummy implementations of strerror_r and strerror_s called if corresponding
|
// Dummy implementations of strerror_r and strerror_s called if corresponding
|
||||||
// system functions are not available.
|
// system functions are not available.
|
||||||
static inline fmt::internal::Null<> strerror_r(int, char *, ...) {
|
static inline fmt::internal::Null<> strerror_r(int, char *, ...) {
|
||||||
@ -84,10 +79,6 @@ static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) {
|
|||||||
return fmt::internal::Null<>();
|
return fmt::internal::Null<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __c2__
|
|
||||||
# pragma clang diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace fmt {
|
namespace fmt {
|
||||||
|
|
||||||
FMT_FUNC internal::RuntimeError::~RuntimeError() FMT_DTOR_NOEXCEPT {}
|
FMT_FUNC internal::RuntimeError::~RuntimeError() FMT_DTOR_NOEXCEPT {}
|
||||||
@ -189,8 +180,9 @@ int safe_strerror(
|
|||||||
: error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {}
|
: error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {}
|
||||||
|
|
||||||
int run() {
|
int run() {
|
||||||
// Suppress a warning about unused strerror_r.
|
// Suppress a warning about unused strerror_r and strerror_s.
|
||||||
strerror_r(0, FMT_NULL, "");
|
strerror_r(0, FMT_NULL, "");
|
||||||
|
strerror_s(FMT_NULL, 0, "");
|
||||||
return handle(strerror_r(error_code_, buffer_, buffer_size_));
|
return handle(strerror_r(error_code_, buffer_, buffer_size_));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user