From: Bruno Haible Date: Thu, 15 Sep 2011 16:00:32 +0000 (+0200) Subject: Support for MSVC compiler: Ensure ssize_t gets defined. X-Git-Tag: v0.1~1906 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=92a1bc6ccf243a67308032234bd69eb31f0028e6;p=gnulib.git Support for MSVC compiler: Ensure ssize_t gets defined. * doc/posix-headers/sys_types.texi: Mention the missing ssize_t problem. * doc/posix-headers/stdio.texi: Likewise. * modules/stdio (Depends-on): Add ssize_t. * modules/sys_socket (Depends-on): Likewise. * modules/sys_types (Depends-on): Likewise. * modules/sys_uio (Depends-on): Likewise. * modules/unistd (Depends-on): Likewise. * tests/test-sys_socket.c: Check that size_t and ssize_t are defined. * tests/test-sys_types.c: Check that ssize_t is defined. --- diff --git a/ChangeLog b/ChangeLog index c5cb4f48f..3717d06a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2011-09-15 Bruno Haible + + Support for MSVC compiler: Ensure ssize_t gets defined. + * doc/posix-headers/sys_types.texi: Mention the missing ssize_t problem. + * doc/posix-headers/stdio.texi: Likewise. + * modules/stdio (Depends-on): Add ssize_t. + * modules/sys_socket (Depends-on): Likewise. + * modules/sys_types (Depends-on): Likewise. + * modules/sys_uio (Depends-on): Likewise. + * modules/unistd (Depends-on): Likewise. + * tests/test-sys_socket.c: Check that size_t and ssize_t are defined. + * tests/test-sys_types.c: Check that ssize_t is defined. + 2011-09-14 Bruno Haible Avoid using #, the m4 comment starter character, near brackets. diff --git a/doc/posix-headers/stdio.texi b/doc/posix-headers/stdio.texi index e4157a792..892290f86 100644 --- a/doc/posix-headers/stdio.texi +++ b/doc/posix-headers/stdio.texi @@ -12,7 +12,7 @@ The type @code{off_t} is missing on some platforms: glibc 2.8, eglibc 2.11.2 and others. @item The type @code{ssize_t} is missing on some platforms: -glibc 2.8, MacOS X 10.5, Solaris 10, and others. +glibc 2.8, MacOS X 10.5, Solaris 10, MSVC 9, and others. @item The type @code{va_list} is missing on some platforms: glibc 2.8, OpenBSD 4.0, Solaris 11 2010-11, and others. diff --git a/doc/posix-headers/sys_types.texi b/doc/posix-headers/sys_types.texi index a7d6cbccd..f124171d8 100644 --- a/doc/posix-headers/sys_types.texi +++ b/doc/posix-headers/sys_types.texi @@ -13,6 +13,9 @@ MSVC 9. @item The type @code{size_t} is not defined in this file on some platforms: MSVC 9. +@item +The type @code{ssize_t} is not defined on some platforms: +MSVC 9. @end itemize Portability problems not fixed by Gnulib: diff --git a/modules/stdio b/modules/stdio index f8880df3f..5fae1b95c 100644 --- a/modules/stdio +++ b/modules/stdio @@ -10,6 +10,7 @@ include_next snippet/arg-nonnull snippet/c++defs snippet/warn-on-use +ssize_t stddef configure.ac: diff --git a/modules/sys_socket b/modules/sys_socket index df0844bf9..82c6909ac 100644 --- a/modules/sys_socket +++ b/modules/sys_socket @@ -14,6 +14,7 @@ snippet/arg-nonnull snippet/c++defs snippet/warn-on-use socklen +ssize_t sys_uio configure.ac: diff --git a/modules/sys_types b/modules/sys_types index 2798676ff..810f640cd 100644 --- a/modules/sys_types +++ b/modules/sys_types @@ -7,6 +7,7 @@ m4/sys_types_h.m4 Depends-on: include_next +ssize_t configure.ac: gl_SYS_TYPES_H diff --git a/modules/sys_uio b/modules/sys_uio index 337ad8f62..45b15eee6 100644 --- a/modules/sys_uio +++ b/modules/sys_uio @@ -7,6 +7,7 @@ m4/sys_uio_h.m4 Depends-on: include_next +ssize_t sys_types configure.ac: diff --git a/modules/unistd b/modules/unistd index 6c8ea1e40..d6642a7f0 100644 --- a/modules/unistd +++ b/modules/unistd @@ -10,6 +10,7 @@ include_next snippet/arg-nonnull snippet/c++defs snippet/warn-on-use +ssize_t stddef configure.ac: diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c index a6e99d600..766bd17b9 100644 --- a/tests/test-sys_socket.c +++ b/tests/test-sys_socket.c @@ -30,6 +30,10 @@ int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; /* Check that the 'socklen_t' type is defined. */ socklen_t t1; +/* Check that the 'size_t' and 'ssize_t' types are defined. */ +size_t t1; +ssize_t t2; + /* Check that 'struct iovec' is defined. */ struct iovec io; diff --git a/tests/test-sys_types.c b/tests/test-sys_types.c index fcd5acf75..bfd9aa548 100644 --- a/tests/test-sys_types.c +++ b/tests/test-sys_types.c @@ -23,6 +23,7 @@ /* Check that the types are all defined. */ pid_t t1; size_t t2; +ssize_t t3; int main (void)