bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ssize_t on MSVC


From: Bruno Haible
Subject: ssize_t on MSVC
Date: Thu, 15 Sep 2011 18:08:58 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

On MSVC 9, ssize_t is not defined, leading to test compilation failures
in test-stdio.c:36, test-sys_uio.c:25, test-unistd.c:40.

According to POSIX:2008, ssize_t ought to be defined in each of
  <stdio.h>
  <sys/socket.h>
  <sys/types.h>
  <sys/uio.h>
  <unistd.h>

This fixes it.


2011-09-15  Bruno Haible  <address@hidden>

        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.

--- doc/posix-headers/stdio.texi.orig   Thu Sep 15 17:57:52 2011
+++ doc/posix-headers/stdio.texi        Thu Sep 15 16:10:15 2011
@@ -12,7 +12,7 @@
 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.
--- doc/posix-headers/sys_types.texi.orig       Thu Sep 15 17:57:52 2011
+++ doc/posix-headers/sys_types.texi    Thu Sep 15 16:10:15 2011
@@ -13,6 +13,9 @@
 @item
 The type @code{size_t} is not defined in this file on some platforms:
 MSVC 9.
address@hidden
+The type @code{ssize_t} is not defined on some platforms:
+MSVC 9.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- modules/stdio.orig  Thu Sep 15 17:57:52 2011
+++ modules/stdio       Thu Sep 15 16:13:37 2011
@@ -10,6 +10,7 @@
 snippet/arg-nonnull
 snippet/c++defs
 snippet/warn-on-use
+ssize_t
 stddef
 
 configure.ac:
--- modules/sys_socket.orig     Thu Sep 15 17:57:52 2011
+++ modules/sys_socket  Thu Sep 15 16:13:38 2011
@@ -14,6 +14,7 @@
 snippet/c++defs
 snippet/warn-on-use
 socklen
+ssize_t
 sys_uio
 
 configure.ac:
--- modules/sys_types.orig      Thu Sep 15 17:57:52 2011
+++ modules/sys_types   Thu Sep 15 16:13:38 2011
@@ -7,6 +7,7 @@
 
 Depends-on:
 include_next
+ssize_t
 
 configure.ac:
 gl_SYS_TYPES_H
--- modules/sys_uio.orig        Thu Sep 15 17:57:52 2011
+++ modules/sys_uio     Thu Sep 15 16:13:38 2011
@@ -7,6 +7,7 @@
 
 Depends-on:
 include_next
+ssize_t
 sys_types
 
 configure.ac:
--- modules/unistd.orig Thu Sep 15 17:57:52 2011
+++ modules/unistd      Thu Sep 15 16:13:38 2011
@@ -10,6 +10,7 @@
 snippet/arg-nonnull
 snippet/c++defs
 snippet/warn-on-use
+ssize_t
 stddef
 
 configure.ac:
--- tests/test-sys_socket.c.orig        Thu Sep 15 17:57:52 2011
+++ tests/test-sys_socket.c     Thu Sep 15 16:06:27 2011
@@ -30,6 +30,10 @@
 /* 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;
 
--- tests/test-sys_types.c.orig Thu Sep 15 17:57:52 2011
+++ tests/test-sys_types.c      Thu Sep 15 16:04:43 2011
@@ -23,6 +23,7 @@
 /* Check that the types are all defined.  */
 pid_t t1;
 size_t t2;
+ssize_t t3;
 
 int
 main (void)

-- 
In memoriam Mala Zimetbaum <http://en.wikipedia.org/wiki/Mala_Zimetbaum>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]