bug-gnulib
[Top][All Lists]
Advanced

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

vasnprintf: support %jd on all platforms


From: Bruno Haible
Subject: vasnprintf: support %jd on all platforms
Date: Mon, 26 Mar 2007 02:13:27 +0200
User-agent: KMail/1.5.4

So far, vasnprintf had support for the 'j' size specifier only on platforms
which have intmax_t. OSF/1 5.1 is a platform which doesn't have intmax_t and
where the intmax_t comes from gnulib's <stdint.h> or from gettext's intmax_t.m4.
The testsuite caught it. This patch should fix it.

2007-03-25  Bruno Haible  <address@hidden>

        * lib/printf-parse.c [!IN_LIBINTL]: Include <stdint.h>, for intmax_t.
        (PRINTF_PARSE): Make the support for size specifier 'j' unconditional.
        * modules/vasnprintf (Depends-on): Add stdint.

*** lib/printf-parse.c  30 Jan 2007 01:07:22 -0000      1.10
--- lib/printf-parse.c  26 Mar 2007 00:05:24 -0000
***************
*** 28,39 ****
  #include <stddef.h>
  
  /* Get intmax_t.  */
! #if HAVE_STDINT_H_WITH_UINTMAX
  # include <stdint.h>
  #endif
- #if HAVE_INTTYPES_H_WITH_UINTMAX
- # include <inttypes.h>
- #endif
  
  /* malloc(), realloc(), free().  */
  #include <stdlib.h>
--- 28,43 ----
  #include <stddef.h>
  
  /* Get intmax_t.  */
! #ifdef IN_LIBINTL
! # if HAVE_STDINT_H_WITH_UINTMAX
! #  include <stdint.h>
! # endif
! # if HAVE_INTTYPES_H_WITH_UINTMAX
! #  include <inttypes.h>
! # endif
! #else
  # include <stdint.h>
  #endif
  
  /* malloc(), realloc(), free().  */
  #include <stdlib.h>
***************
*** 326,332 ****
                      flags += 8;
                      cp++;
                    }
- #if HAVE_INTMAX_T
                  else if (*cp == 'j')
                    {
                      if (sizeof (intmax_t) > sizeof (long))
--- 330,335 ----
***************
*** 341,347 ****
                        }
                      cp++;
                    }
- #endif
                  else if (*cp == 'z' || *cp == 'Z')
                    {
                      /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
--- 344,349 ----
*** modules/vasnprintf  25 Mar 2007 02:22:44 -0000      1.12
--- modules/vasnprintf  26 Mar 2007 00:05:24 -0000
***************
*** 22,27 ****
--- 22,28 ----
  
  Depends-on:
  alloca-opt
+ stdint
  xsize
  
  configure.ac:





reply via email to

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