# HG changeset patch # User Bruno Haible # Date 1316206549 -7200 # Node ID 4afad5701552edd7504455a9c45416d61396893d # Parent a508d7847f6d0e6e13868df1c1d0cef79279d835 Support for MSVC compiler: Ensure off_t gets defined. * lib/unistd.in.h: Include . * tests/test-fcntl-h.c: Check that off_t is defined. * tests/test-sys_stat.c: Likewise. * tests/test-sys_types.c: Likewise. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-09-16 Bruno Haible + + Support for MSVC compiler: Ensure off_t gets defined. + * lib/unistd.in.h: Include . + * 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 fdatasync: port to Solaris diff --git a/lib/unistd.in.h b/lib/unistd.in.h --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -98,6 +98,12 @@ # include #endif +/* MSVC defines off_t in . */ +#if !@HAVE_UNISTD_H@ +/* Get off_t. */ +# include +#endif + #if (@GNULIB_READ@ || @GNULIB_WRITE@ \ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK) diff --git a/tests/test-fcntl-h.c b/tests/test-fcntl-h.c --- a/tests/test-fcntl-h.c +++ b/tests/test-fcntl-h.c @@ -33,6 +33,7 @@ /* Check that the types are all defined. */ pid_t t1; +off_t t2; int main (void) diff --git a/tests/test-sys_stat.c b/tests/test-sys_stat.c --- a/tests/test-sys_stat.c +++ b/tests/test-sys_stat.c @@ -278,8 +278,9 @@ /* Check the existence of some types. */ nlink_t t1; +off_t t2; -struct timespec t2; +struct timespec t3; int main (void) diff --git a/tests/test-sys_types.c b/tests/test-sys_types.c --- a/tests/test-sys_types.c +++ b/tests/test-sys_types.c @@ -24,6 +24,7 @@ pid_t t1; size_t t2; ssize_t t3; +off_t t4; int main (void)