Ensure that <unistd.h> and <fcntl.h> define SEEK_CUR etc.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Apr 2007 06:46:57 +0000 (06:46 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Apr 2007 06:46:57 +0000 (06:46 +0000)
ChangeLog
lib/unistd_.h
tests/test-fcntl.c
tests/test-stdio.c
tests/test-unistd.c

index 0c552c2..33c7d57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-25  Bruno Haible  <bruno@clisp.org>
+
+       * lib/unistd_.h: Include <stdio.h> if needed to get the SEEK_* macros.
+       * tests/test-stdio.c: Check that the various SEEK_* macros are defined.
+       * tests/test-unistd.c: Likewise.
+       * tests/test-fcntl.c: Likewise.
+
 2007-04-23  Eric Blake  <ebb9@byu.net>
 
        * lib/fflush.c: Fix missing include.
index 77df861..344b5a3 100644 (file)
 # include @ABSOLUTE_UNISTD_H@
 #endif
 
+/* mingw doesn't define the SEEK_* macros in <unistd.h>.  */
+#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
+# include <stdio.h>
+#endif
+
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
index cc95668..21f67cf 100644 (file)
@@ -26,6 +26,9 @@ int o = O_DIRECT | O_DIRECTORY | O_DSYNC | O_NDELAY | O_NOATIME | O_NONBLOCK
        | O_NOCTTY | O_NOFOLLOW | O_NOLINKS | O_RSYNC | O_SYNC
        | O_BINARY | O_TEXT;
 
+/* Check that the various SEEK_* macros are defined.  */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
+
 int
 main ()
 {
index 3f97c9d..96ea59a 100644 (file)
@@ -21,6 +21,9 @@
 
 #include <stdio.h>
 
+/* Check that the various SEEK_* macros are defined.  */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
+
 int
 main ()
 {
index a81bd7a..755708a 100644 (file)
@@ -21,6 +21,9 @@
 
 #include <unistd.h>
 
+/* Check that the various SEEK_* macros are defined.  */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
+
 int
 main ()
 {