public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: fcntl.h: Use test macros to guard non-standard open flags
@ 2017-11-14 20:46 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-11-14 20:46 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=baaceb8f37ad65ea9bb735bc154859e032d9fef4

commit baaceb8f37ad65ea9bb735bc154859e032d9fef4
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue Nov 14 21:31:31 2017 +0100

    Cygwin: fcntl.h: Use test macros to guard non-standard open flags
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/include/sys/_default_fcntl.h | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h
index 7c07e3e..006e4ef 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-14 20:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 20:46 [newlib-cygwin] Cygwin: fcntl.h: Use test macros to guard non-standard open flags Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).