From b5f0ec49deaa5dd52244755f609b2e865ac487fc Mon Sep 17 00:00:00 2001 From: Acretock Date: Mon, 29 Nov 2021 17:30:05 +0500 Subject: [PATCH] change unsigned int to mode_t --- src/os.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/os.cc b/src/os.cc index 25f72669..4e711941 100644 --- a/src/os.cc +++ b/src/os.cc @@ -20,6 +20,9 @@ # ifndef _WIN32 # include +# ifndef mode_t +# define mode_t unsigned int +# endif # else # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN @@ -41,6 +44,9 @@ # ifndef S_IROTH # define S_IROTH 0 # endif +# ifndef mode_t +# define mode_t int +# endif # ifdef __MINGW32__ # define _SH_DENYNO 0x40 @@ -218,7 +224,7 @@ int buffered_file::fileno() const { #if FMT_USE_FCNTL file::file(cstring_view path, int oflag) { - unsigned int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; # if defined(_WIN32) && !defined(__MINGW32__) fd_ = -1; FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode));