Remove deprecated APIs

This commit is contained in:
Victor Zverovich
2022-05-22 06:49:31 -07:00
parent edeb3d8091
commit ce246aaf74
7 changed files with 16 additions and 66 deletions

View File

@@ -51,10 +51,6 @@
# include <windows.h>
#endif
#ifdef fileno
# undef fileno
#endif
namespace {
#ifdef _WIN32
// Return type of read and write functions.
@@ -206,11 +202,8 @@ void buffered_file::close() {
if (result != 0) FMT_THROW(system_error(errno, "cannot close file"));
}
// A macro used to prevent expansion of fileno on broken versions of MinGW.
#define FMT_ARGS
int buffered_file::fileno() const {
int fd = FMT_POSIX_CALL(fileno FMT_ARGS(file_));
int buffered_file::descriptor() const {
int fd = FMT_POSIX_CALL(fileno(file_));
if (fd == -1) FMT_THROW(system_error(errno, "cannot get file descriptor"));
return fd;
}