]> Savannah Git Hosting - gnulib.git/commitdiff
Support for MSVC compiler: Ensure off_t gets defined.
authorBruno Haible <bruno@clisp.org>
Fri, 16 Sep 2011 20:55:49 +0000 (22:55 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 16 Sep 2011 20:55:49 +0000 (22:55 +0200)
* lib/unistd.in.h: Include <sys/types.h>.
* tests/test-fcntl-h.c: Check that off_t is defined.
* tests/test-sys_stat.c: Likewise.
* tests/test-sys_types.c: Likewise.

ChangeLog
lib/unistd.in.h
tests/test-fcntl-h.c
tests/test-sys_stat.c
tests/test-sys_types.c

index 1da8266ac6fe54c79227018a2730b010fcde7025..056daba483df2fd40d4be963f0b8e23b8b2b588c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-16  Bruno Haible  <bruno@clisp.org>
+
+       Support for MSVC compiler: Ensure off_t gets defined.
+       * lib/unistd.in.h: Include <sys/types.h>.
+       * tests/test-fcntl-h.c: Check that off_t is defined.
+       * tests/test-sys_stat.c: Likewise.
+       * tests/test-sys_types.c: Likewise.
+
 2011-09-16  Eric Blake  <eblake@redhat.com>
 
        fdatasync: port to Solaris
index 1c67173d5ad83e2fcf908dca4c3246292c9069b5..90de697e0d3eb81268bc39138294c66a339918b8 100644 (file)
 # include <netdb.h>
 #endif
 
+/* MSVC defines off_t in <sys/types.h>.  */
+#if !@HAVE_UNISTD_H@
+/* Get off_t.  */
+# include <sys/types.h>
+#endif
+
 #if (@GNULIB_READ@ || @GNULIB_WRITE@ \
      || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
      || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
index 078aecdd44a8e8bc49803b0225f128efc4582990..f3520d148ee1ec9634000f657055c55df92fe4c5 100644 (file)
@@ -33,6 +33,7 @@ int i = FD_CLOEXEC;
 
 /* Check that the types are all defined.  */
 pid_t t1;
+off_t t2;
 
 int
 main (void)
index cd07d86e876cc417a3e11094bdb09ff01c08d59a..ec18ad07240560697f4a599278d812bc65f02090 100644 (file)
@@ -278,8 +278,9 @@ invalid UTIME macros
 
 /* Check the existence of some types.  */
 nlink_t t1;
+off_t t2;
 
-struct timespec t2;
+struct timespec t3;
 
 int
 main (void)
index bfd9aa548f5cca595781d4e0e227be96c93fe75c..b95706f1db20cca06dd7ef2faf8da4e577905760 100644 (file)
@@ -24,6 +24,7 @@
 pid_t t1;
 size_t t2;
 ssize_t t3;
+off_t t4;
 
 int
 main (void)