bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] ssize_t and mingw32


From: Bruno Haible
Subject: [Bug-gnulib] ssize_t and mingw32
Date: Mon, 23 Jun 2003 12:51:57 +0200
User-agent: KMail/1.5

Hi,

mingw32 has no ssize_t nowhere, not in <sys/types.h> and not in <unistd.h>,
therefore some modules which use it must define ssize_t to 'int' on this
platform. It was reported to me due to a compilation error in libiconv.

Any objections against this patch, Jim?

Bruno


*** m4/ChangeLog        11 Jun 2003 10:42:09 -0000      1.456
--- m4/ChangeLog        23 Jun 2003 10:45:59 -0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2003-06-22  Bruno Haible  <address@hidden>
+ 
+       Portability to mingw32.
+       * ssize_t.m4: New file, from GNU gettext.
+       * safe-read.m4 (gl_PREREQ_SAFE_READ): Require gt_TYPE_SSIZE_T.
+       * xreadlink.m4 (gl_XREADLINK): Require gt_TYPE_SSIZE_T.
+ 
  2003-06-11  Bruno Haible  <address@hidden>
  
        * sysexits.m4: New file.
*** /dev/null   Thu Jan  1 01:00:00 1970
--- m4/ssize_t.m4       Sun Jun 22 19:09:33 2003
***************
*** 0 ****
--- 1,26 ----
+ # ssize_t.m4 serial 2 (gettext-0.12.2)
+ dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+ dnl General Public License.  As a special exception to the GNU General
+ dnl Public License, this file may be distributed as part of a program
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+ 
+ dnl From Bruno Haible.
+ dnl Test whether ssize_t is defined.
+ 
+ AC_DEFUN([gt_TYPE_SSIZE_T],
+ [
+   AC_CHECK_HEADERS_ONCE(unistd.h)
+   AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t,
+     [AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif], [int x = sizeof (ssize_t *) + sizeof (ssize_t);],
+        gt_cv_ssize_t=yes, gt_cv_ssize_t=no)])
+   if test $gt_cv_ssize_t = no; then
+     AC_DEFINE(ssize_t, int,
+               [Define as a signed type of the same size as size_t.])
+   fi
+ ])
*** m4/safe-read.m4     31 Dec 2002 13:42:07 -0000      1.1
--- m4/safe-read.m4     23 Jun 2003 10:45:59 -0000
***************
*** 1,5 ****
! # safe-read.m4 serial 1
! dnl Copyright (C) 2002 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
  dnl Public License, this file may be distributed as part of a program
--- 1,5 ----
! # safe-read.m4 serial 2
! dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
  dnl Public License, this file may be distributed as part of a program
***************
*** 14,18 ****
--- 14,19 ----
  # Prerequisites of lib/safe-read.c.
  AC_DEFUN([gl_PREREQ_SAFE_READ],
  [
+   AC_REQUIRE([gt_TYPE_SSIZE_T])
    AC_CHECK_HEADERS_ONCE(unistd.h)
  ])
*** m4/xreadlink.m4     29 May 2003 07:21:59 -0000      1.2
--- m4/xreadlink.m4     23 Jun 2003 10:45:59 -0000
***************
*** 1,4 ****
! # xreadlink.m4 serial 2
  dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
--- 1,4 ----
! # xreadlink.m4 serial 3
  dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
***************
*** 9,13 ****
--- 9,14 ----
  AC_DEFUN([gl_XREADLINK],
  [
    dnl Prerequisites of lib/xreadlink.c.
+   AC_REQUIRE([gt_TYPE_SSIZE_T])
    AC_CHECK_HEADERS_ONCE(stdlib.h sys/types.h unistd.h)
  ])
*** ChangeLog   11 Jun 2003 10:42:09 -0000      1.55
--- ChangeLog   23 Jun 2003 10:45:59 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2003-06-22  Bruno Haible  <address@hidden>
+ 
+       * modules/safe-read: Add m4/ssize_t.m4.
+       * modules/xreadlink: Add m4/ssize_t.m4.
+ 
  2003-06-11  Simon Josefsson  <address@hidden>
  
        * modules/sysexits: New file.
*** modules/safe-read   20 Jan 2003 10:02:38 -0000      1.3
--- modules/safe-read   23 Jun 2003 10:45:59 -0000
***************
*** 5,10 ****
--- 5,11 ----
  lib/safe-read.h
  lib/safe-read.c
  m4/safe-read.m4
+ m4/ssize_t.m4
  
  Depends-on:
  
*** modules/xreadlink   20 Jan 2003 10:02:38 -0000      1.3
--- modules/xreadlink   23 Jun 2003 10:45:59 -0000
***************
*** 5,10 ****
--- 5,11 ----
  lib/xreadlink.h
  lib/xreadlink.c
  m4/xreadlink.m4
+ m4/ssize_t.m4
  
  Depends-on:
  xalloc





reply via email to

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