diff options
author | Bruno Haible <bruno@clisp.org> | 2019-09-15 18:32:54 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-09-15 18:32:54 +0200 |
commit | 7ed78c9f539e6981b7ba48ef2962d4364cbd37fc (patch) | |
tree | 126712fdeb289f65c03df18ac629b517f0e179dc | |
parent | 01c0052307a4c87926b664d288fa5ba801eaa8ff (diff) | |
download | gnulib-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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/fcntl.in.h | 18 |
2 files changed, 18 insertions, 6 deletions
@@ -1,8 +1,14 @@ 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. creat: New module. * lib/fcntl.in.h (creat): New declaration. 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 @@ -36,12 +36,18 @@ with g++ version >= 4.3. */ #if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))) # include <sys/stat.h> #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. */ #ifndef _@GUARD_PREFIX@_FCNTL_H /* Needed before <sys/stat.h>. @@ -56,25 +62,25 @@ #if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))) # include <sys/stat.h> #endif /* 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 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ # 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. */ /* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ |