summaryrefslogtreecommitdiff
path: root/lib/fcntl.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-09-15 18:32:54 +0200
committerBruno Haible <bruno@clisp.org>2019-09-15 18:32:54 +0200
commit7ed78c9f539e6981b7ba48ef2962d4364cbd37fc (patch)
tree126712fdeb289f65c03df18ac629b517f0e179dc /lib/fcntl.in.h
parent01c0052307a4c87926b664d288fa5ba801eaa8ff (diff)
downloadgnulib-7ed78c9f539e6981b7ba48ef2962d4364cbd37fc.tar.gz
fcntl-h: Fix compilation error of creat.c on MSVC.
* lib/fcntl.in.h: Include <io.h> also when __need_system_fcntl_h is defined.
Diffstat (limited to 'lib/fcntl.in.h')
-rw-r--r--lib/fcntl.in.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 557e6c14b2..abe7993e21 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -39,6 +39,12 @@
#endif
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
#else
/* Normal invocation convention. */
@@ -59,6 +65,12 @@
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
#ifndef _@GUARD_PREFIX@_FCNTL_H
#define _@GUARD_PREFIX@_FCNTL_H
@@ -66,12 +78,6 @@
# include <unistd.h>
#endif
-/* Native Windows platforms declare open(), creat() in <io.h>. */
-#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
- && (defined _WIN32 && ! defined __CYGWIN__)
-# include <io.h>
-#endif
-
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */