aboutsummaryrefslogtreecommitdiff
path: root/src/posix.cc
diff options
context:
space:
mode:
authorVictor Zverovich <victor.zverovich@gmail.com>2019-11-15 05:41:14 -0800
committerVictor Zverovich <victor.zverovich@gmail.com>2019-11-15 07:28:02 -0800
commitdcde089b4edaecb42c4bdd43c5b3674017a00d91 (patch)
tree834f7eb85247a0861bc63127cd5b0fb703ce759c /src/posix.cc
parent2145a7bdccdda0b39d96a99f943123317145b874 (diff)
downloadfmtlib-dcde089b4edaecb42c4bdd43c5b3674017a00d91.tar.gz
Improve POSIX API detection
Diffstat (limited to 'src/posix.cc')
-rw-r--r--src/posix.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/posix.cc b/src/posix.cc
index 79b8ecbe..3db72b76 100644
--- a/src/posix.cc
+++ b/src/posix.cc
@@ -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