Improve POSIX API detection

This commit is contained in:
Victor Zverovich
2019-11-15 05:41:14 -08:00
parent 2145a7bdcc
commit dcde089b4e
12 changed files with 67 additions and 55 deletions

View File

@@ -13,6 +13,8 @@
#include "fmt/posix.h"
#include <climits>
#if FMT_USE_FCNTL
#include <sys/stat.h>
#include <sys/types.h>
@@ -39,8 +41,8 @@
# ifdef __MINGW32__
# define _SH_DENYNO 0x40
# endif
#endif // _WIN32
#endif // FMT_USE_FCNTL
#ifdef fileno
# undef fileno
@@ -94,6 +96,7 @@ int buffered_file::fileno() const {
return fd;
}
#if FMT_USE_FCNTL
file::file(cstring_view path, int oflag) {
int mode = S_IRUSR | S_IWUSR;
#if defined(_WIN32) && !defined(__MINGW32__)
@@ -230,4 +233,5 @@ long getpagesize() {
return size;
#endif
}
#endif // FMT_USE_FCNTL
FMT_END_NAMESPACE