From 7ed78c9f539e6981b7ba48ef2962d4364cbd37fc Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 15 Sep 2019 18:32:54 +0200 Subject: [PATCH] fcntl-h: Fix compilation error of creat.c on MSVC. * lib/fcntl.in.h: Include also when __need_system_fcntl_h is defined. --- ChangeLog | 6 ++++++ lib/fcntl.in.h | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c7ca6b238..84d9508c1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-09-15 Bruno Haible + + fcntl-h: Fix compilation error of creat.c on MSVC. + * lib/fcntl.in.h: Include also when __need_system_fcntl_h is + defined. + 2019-09-15 Bruno Haible creat: Add tests. 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 . */ +#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && (defined _WIN32 && ! defined __CYGWIN__) +# include +#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 . */ +#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && (defined _WIN32 && ! defined __CYGWIN__) +# include +#endif + #ifndef _@GUARD_PREFIX@_FCNTL_H #define _@GUARD_PREFIX@_FCNTL_H @@ -66,12 +78,6 @@ # include #endif -/* Native Windows platforms declare open(), creat() in . */ -#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ - && (defined _WIN32 && ! defined __CYGWIN__) -# include -#endif - /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -- 2.39.5