mirror of
https://github.com/fmtlib/fmt.git
synced 2025-03-15 16:20:59 +00:00
Fix warnings
This commit is contained in:
parent
0b635c9dc5
commit
6cb68f9496
@ -59,10 +59,10 @@
|
||||
|
||||
// Dummy implementations of strerror_r and strerror_s called if corresponding
|
||||
// system functions are not available.
|
||||
static inline fmt::internal::null<> strerror_r(int, char *, ...) {
|
||||
inline fmt::internal::null<> strerror_r(int, char *, ...) {
|
||||
return fmt::internal::null<>();
|
||||
}
|
||||
static inline fmt::internal::null<> strerror_s(char *, std::size_t, ...) {
|
||||
inline fmt::internal::null<> strerror_s(char *, std::size_t, ...) {
|
||||
return fmt::internal::null<>();
|
||||
}
|
||||
|
||||
@ -157,8 +157,6 @@ int safe_strerror(
|
||||
: error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {}
|
||||
|
||||
int run() {
|
||||
// Suppress a warning about unused strerror_r.
|
||||
strerror_r(0, FMT_NULL, "");
|
||||
return handle(strerror_r(error_code_, buffer_, buffer_size_));
|
||||
}
|
||||
};
|
||||
|
@ -160,7 +160,10 @@
|
||||
|
||||
namespace fmt {
|
||||
namespace internal {
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
|
||||
# ifndef __clang__
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
# endif
|
||||
inline uint32_t clz(uint32_t x) {
|
||||
unsigned long r = 0;
|
||||
_BitScanReverse(&r, x);
|
||||
@ -174,7 +177,7 @@ inline uint32_t clz(uint32_t x) {
|
||||
}
|
||||
# define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n)
|
||||
|
||||
# ifdef _WIN64
|
||||
# if defined(_WIN64) && !defined(__clang__)
|
||||
# pragma intrinsic(_BitScanReverse64)
|
||||
# endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user