diff options
author | Eric Blake <ebb9@byu.net> | 2009-12-24 06:01:43 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-12-24 06:09:40 -0700 |
commit | d3e8c326354490860582c5e4293a2f29bbd14530 (patch) | |
tree | 5253999a0e330d30f170e49455aec43f81ce401e /lib/unistd.in.h | |
parent | 3e2d7ac6c75ad7c92d25f59d11bd455d37ba4e37 (diff) | |
download | gnulib-d3e8c326354490860582c5e4293a2f29bbd14530.tar.gz |
build: pull in conditional headers during GNULIB_POSIXCHECK
Any time we conditionally include a header in order to satisfy
prerequisites of one module, we must also include that header
under GNULIB_POSIXCHECK to avoid compilation errors if that
module is not in use. If this is not done, then our link warning
override can occur before the system's declaration, which
causes a syntax error when the system header is finally included.
* lib/stdio.in.h (includes): Using GNULIB_POSIXCHECK also requires
definitions from any conditionally-included headers.
* lib/stdlib.in.h (includes): Likewise.
* lib/unistd.in.h (includes): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/unistd.in.h')
-rw-r--r-- | lib/unistd.in.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index d0188f58ed..1a11d1a89d 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -35,12 +35,12 @@ /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */ #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ - || @GNULIB_SYMLINKAT@) + || @GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) # include <stdio.h> #endif /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */ -#if @GNULIB_UNLINKAT@ +#if @GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK # include <fcntl.h> #endif @@ -50,13 +50,15 @@ #include <stdlib.h> /* mingw declares getcwd in <io.h>, not in <unistd.h>. */ -#if @GNULIB_GETCWD@ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) # include <io.h> #endif #if ((@GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@) \ || (@GNULIB_READLINK@ && (!@HAVE_READLINK@ || @REPLACE_READLINK@)) \ - || (@GNULIB_READLINKAT@ && !@HAVE_READLINKAT@)) + || (@GNULIB_READLINKAT@ && !@HAVE_READLINKAT@) \ + || defined GNULIB_POSIXCHECK) /* Get ssize_t. */ # include <sys/types.h> #endif |