bug-gnulib
[Top][All Lists]
Advanced

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

stdint.h and Linux libc5


From: Bruno Haible
Subject: stdint.h and Linux libc5
Date: Mon, 17 Oct 2005 12:34:28 +0200
User-agent: KMail/1.5

Hi,

It was reported to me that the use of module 'stdint' on Linux/libc5 with
gcc-2.7.2.1 gives an error. The reason is that <sys/bitypes.h>, included
by <sys/types.h>, already defines int8_t, int16_t and int32_t.

Here's a proposed fix, that I will send to the reporter for testing.

Bruno


2005-10-16  Bruno Haible  <address@hidden>

        * m4/stdint.m4 (gl_STDINT_H): Also test for <sys/bitypes.h>.
        * lib/stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h>
        and don't define _STDINT_H_NEED_SIGNED_INT_TYPES.

diff -c -3 -r1.3 stdint.m4
*** m4/stdint.m4        17 Mar 2005 18:31:09 -0000      1.3
--- m4/stdint.m4        17 Oct 2005 10:34:49 -0000
***************
*** 1,4 ****
! # stdint.m4 serial 4
  dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # stdint.m4 serial 5
  dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 12,17 ****
--- 12,19 ----
  AC_REQUIRE([gt_HEADER_INTTYPES_H])
  dnl Check for <sys/inttypes.h>.
  AC_CHECK_HEADERS([sys/inttypes.h])
+ dnl Check for <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
+ AC_CHECK_HEADERS([sys/bitypes.h])
  
  AC_MSG_CHECKING([for stdint.h])
  AC_CACHE_VAL(gl_cv_header_stdint_h, [
diff -c -3 -r1.7 stdint_.h
*** lib/stdint_.h       23 May 2005 10:22:39 -0000      1.7
--- lib/stdint_.h       17 Oct 2005 10:34:49 -0000
***************
*** 33,38 ****
--- 33,44 ----
  #if defined(__FreeBSD__)
  # include <sys/inttypes.h>
  #endif
+ #if defined(__linux__) && HAVE_SYS_BITYPES_H
+   /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
+      int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is
+      included by <sys/types.h>.  */
+ # include <sys/bitypes.h>
+ #endif
  #if defined(__sun) && HAVE_SYS_INTTYPES_H
  # include <sys/inttypes.h>
    /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
***************
*** 48,54 ****
       UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX.  */
  # define _STDINT_H_HAVE_SYSTEM_INTTYPES
  #endif
! #if !(defined(UNIX_CYGWIN32) && defined(__BIT_TYPES_DEFINED__))
  # define _STDINT_H_NEED_SIGNED_INT_TYPES
  #endif
  
--- 54,60 ----
       UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX.  */
  # define _STDINT_H_HAVE_SYSTEM_INTTYPES
  #endif
! #if !((defined(UNIX_CYGWIN32) || defined(__linux__)) && 
defined(__BIT_TYPES_DEFINED__))
  # define _STDINT_H_NEED_SIGNED_INT_TYPES
  #endif
  





reply via email to

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