summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2017-11-14 21:31:31 +0100
committerCorinna Vinschen <corinna@vinschen.de>2017-11-14 21:45:31 +0100
commitbaaceb8f37ad65ea9bb735bc154859e032d9fef4 (patch)
tree1e1eb72e03583e96fcc6a735dbb9c99018da53d8
parentf9d071aaf8fdabc610aa3d595c06ca795c019e28 (diff)
downloadcygnal-baaceb8f37ad65ea9bb735bc154859e032d9fef4.tar.gz
cygnal-baaceb8f37ad65ea9bb735bc154859e032d9fef4.tar.bz2
cygnal-baaceb8f37ad65ea9bb735bc154859e032d9fef4.zip
Cygwin: fcntl.h: Use test macros to guard non-standard open flags
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--newlib/libc/include/sys/_default_fcntl.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h
index 7c07e3efa..006e4efd5 100644
--- a/newlib/libc/include/sys/_default_fcntl.h
+++ b/newlib/libc/include/sys/_default_fcntl.h
@@ -57,17 +57,25 @@ extern "C" {
#define O_BINARY _FBINARY
#define O_TEXT _FTEXT
-#define O_CLOEXEC _FNOINHERIT
-#define O_DIRECT _FDIRECT
-#define O_NOFOLLOW _FNOFOLLOW
#define O_DSYNC _FSYNC
#define O_RSYNC _FSYNC
-#define O_DIRECTORY _FDIRECTORY
#define O_EXEC _FEXECSRCH
#define O_SEARCH _FEXECSRCH
+
+/* POSIX-1.2008 specific flags */
+#if __POSIX_VISIBLE >= 200809
+#define O_CLOEXEC _FNOINHERIT
+#define O_NOFOLLOW _FNOFOLLOW
+#define O_DIRECTORY _FDIRECTORY
+#endif
+
+/* Linux-specific flags */
+#if __GNU_VISIBLE
+#define O_DIRECT _FDIRECT
#define O_TMPFILE _FTMPFILE
#define O_NOATIME _FNOATIME
#endif
+#endif
#if __MISC_VISIBLE