summaryrefslogtreecommitdiffabout
authorBruno Haible <bruno@clisp.org>2019-09-15 16:32:54 (GMT)
committer Bruno Haible <bruno@clisp.org>2019-09-15 16:32:54 (GMT)
commit7ed78c9f539e6981b7ba48ef2962d4364cbd37fc (patch) (side-by-side diff)
tree126712fdeb289f65c03df18ac629b517f0e179dc
parent01c0052307a4c87926b664d288fa5ba801eaa8ff (diff)
downloadgnulib-7ed78c9f539e6981b7ba48ef2962d4364cbd37fc.tar.gz
gnulib-7ed78c9f539e6981b7ba48ef2962d4364cbd37fc.tar.bz2
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 (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog6
-rw-r--r--lib/fcntl.in.h18
2 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c7ca6b..84d9508 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2019-09-15 Bruno Haible <bruno@clisp.org>
+ 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.
+
+2019-09-15 Bruno Haible <bruno@clisp.org>
+
creat: Add tests.
* tests/test-creat.c: New file, based on tests/test-open.h.
* modules/creat-tests: New file.
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 557e6c1..abe7993 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. */

Return to:

Send suggestions and report system problems to the System administrator.