diff --git a/include/fmt/format.cc b/include/fmt/format.cc index 4eaf91a8..edecd87d 100644 --- a/include/fmt/format.cc +++ b/include/fmt/format.cc @@ -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_)); } }; diff --git a/include/fmt/format.h b/include/fmt/format.h index 56574934..fde7ab4f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -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