summaryrefslogtreecommitdiff
path: root/lib/fcntl.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fcntl.in.h')
-rw-r--r--lib/fcntl.in.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index a1e7d35..b2e1e51 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -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_OPEN@ || defined GNULIB_POSIXCHECK) \
- && (defined _WIN32 && ! defined __CYGWIN__)
-# include <io.h>
-#endif
-
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -82,6 +88,26 @@
/* Declare overridden functions. */
+#if @GNULIB_CREAT@
+# if @REPLACE_CREAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat rpl_creat
+# endif
+_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#elif defined GNULIB_POSIXCHECK
+# undef creat
+/* Assume creat is always declared. */
+_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
+ "use gnulib module creat for portability");
+#endif
+
#if @GNULIB_FCNTL@
# if @REPLACE_FCNTL@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)