Silence "warning: declaration of '*' shadows a member of 'this' [-Wshadow]" on mingw-gcc
This commit is contained in:
parent
a243548cec
commit
02aeb79cdc
@ -487,6 +487,11 @@ FMT_FUNC int fmt::internal::UTF16ToUTF8::convert(fmt::WStringRef s) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wshadow"
|
||||||
|
# endif
|
||||||
|
|
||||||
FMT_FUNC void fmt::WindowsError::init(
|
FMT_FUNC void fmt::WindowsError::init(
|
||||||
int error_code, StringRef format_str, ArgList args) {
|
int error_code, StringRef format_str, ArgList args) {
|
||||||
error_code_ = error_code;
|
error_code_ = error_code;
|
||||||
@ -496,6 +501,10 @@ FMT_FUNC void fmt::WindowsError::init(
|
|||||||
base = std::runtime_error(w.str());
|
base = std::runtime_error(w.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FMT_FUNC void fmt::internal::format_system_error(
|
FMT_FUNC void fmt::internal::format_system_error(
|
||||||
|
|||||||
8
posix.cc
8
posix.cc
@ -134,13 +134,13 @@ void fmt::File::close() {
|
|||||||
|
|
||||||
fmt::LongLong fmt::File::size() const {
|
fmt::LongLong fmt::File::size() const {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LARGE_INTEGER size = {};
|
LARGE_INTEGER filesize = {};
|
||||||
HANDLE handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd_));
|
HANDLE handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd_));
|
||||||
if (!FMT_SYSTEM(GetFileSizeEx(handle, &size)))
|
if (!FMT_SYSTEM(GetFileSizeEx(handle, &filesize)))
|
||||||
throw WindowsError(GetLastError(), "cannot get file size");
|
throw WindowsError(GetLastError(), "cannot get file size");
|
||||||
FMT_STATIC_ASSERT(sizeof(fmt::LongLong) >= sizeof(size.QuadPart),
|
FMT_STATIC_ASSERT(sizeof(fmt::LongLong) >= sizeof(filesize.QuadPart),
|
||||||
"return type of File::size is not large enough");
|
"return type of File::size is not large enough");
|
||||||
return size.QuadPart;
|
return filesize.QuadPart;
|
||||||
#else
|
#else
|
||||||
typedef struct stat Stat;
|
typedef struct stat Stat;
|
||||||
Stat file_stat = Stat();
|
Stat file_stat = Stat();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user