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 0c552c2ed98db6ce3e693862f5722ed12b2956c0..33c7d57fd651c48beb7a29ec0b885fe8a14399e2 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 77df86116ffbef7db14dc4366aecae12235f68f9..344b5a388823a78509d23db7963cd28c6825b0dd 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 cc956688e91a7069267170558ccf460b6be54811..21f67cf11fb4c455fb9fe8d861334833accdb480 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 3f97c9d8f4bf99efcf8d33c16246f945471f6c4a..96ea59a2dbb886f60375fe715bedcbcd1e284573 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 a81bd7a58892830a9db1f609611018ff46473244..755708ac0309bb67478dadb0d28e53fd49dd3aff 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 ()
 {