bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] printf %lld versus %Ld for Tandem NSK (OSS)


From: Bruno Haible
Subject: Re: [bug-gnulib] printf %lld versus %Ld for Tandem NSK (OSS)
Date: Thu, 12 Oct 2006 14:52:33 +0200
User-agent: KMail/1.9.1

Paul Eggert wrote:
> 2006-10-11  Paul Eggert  <address@hidden>
> 
>       * lib/inttypes_.h (_LONG_LONG_FORMAT_PREFIX): New macro.
>       Add support for Tandem NonStop R series.
>       (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX):
>       Use new macro.
> 
> --- lib/inttypes_.h   11 Oct 2006 05:58:47 -0000      1.4
> +++ lib/inttypes_.h   12 Oct 2006 06:17:55 -0000      1.5
> @@ -157,10 +167,8 @@
>  # ifdef INT64_MAX
>  #  if INT64_MAX == LONG_MAX
>  #   define _PRI64_PREFIX "l"
> -#  elif defined _MSC_VER || defined __MINGW32__
> -#   define _PRI64_PREFIX "I64"
>  #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
> -#   define _PRI64_PREFIX "ll"
> +#   define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
>  #  endif
>  #  if !defined PRId64 || @PRI_MACROS_BROKEN@
>  #   undef PRId64

This mishandles the _MSC_VER (MSVC) platform: since it doesn't have
a 'long long' type, @HAVE_LONG_LONG_INT@ is not defined there. I'm
fixing this by moving the MSVC || MINGW32 cases back.

2006-10-12  Bruno Haible  <address@hidden>

        * lib/inttypes_.h (_LONG_LONG_FORMAT_PREFIX): Don't define for MSVC or
        mingw.
        (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX): Handle
        MSVC and mingw explicitly.

diff -c -3 -r1.5 inttypes_.h
*** lib/inttypes_.h     12 Oct 2006 06:17:55 -0000      1.5
--- lib/inttypes_.h     12 Oct 2006 12:49:25 -0000
***************
*** 46,54 ****
  
  #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
  
! # if defined _MSC_VER || defined __MINGW32__
! #  define _LONG_LONG_FORMAT_PREFIX "I64"
! # elif defined _TNS_R_TARGET
     /* Tandem NonStop R series and compatible platforms released before
        July 2005 support %Ld but not %lld.  */
  #  define _LONG_LONG_FORMAT_PREFIX "L"
--- 46,52 ----
  
  #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
  
! # if defined _TNS_R_TARGET
     /* Tandem NonStop R series and compatible platforms released before
        July 2005 support %Ld but not %lld.  */
  #  define _LONG_LONG_FORMAT_PREFIX "L"
***************
*** 167,172 ****
--- 165,172 ----
  # ifdef INT64_MAX
  #  if INT64_MAX == LONG_MAX
  #   define _PRI64_PREFIX "l"
+ #  elif defined _MSC_VER || defined __MINGW32__
+ #   define _PRI64_PREFIX "I64"
  #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
  #   define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
  #  endif
***************
*** 182,187 ****
--- 182,189 ----
  # ifdef UINT64_MAX
  #  if UINT64_MAX == ULONG_MAX
  #   define _PRIu64_PREFIX "l"
+ #  elif defined _MSC_VER || defined __MINGW32__
+ #   define _PRIu64_PREFIX "I64"
  #  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
  #   define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
  #  endif
***************
*** 656,661 ****
--- 658,665 ----
  # ifdef INT64_MAX
  #  if INT64_MAX == LONG_MAX
  #   define _SCN64_PREFIX "l"
+ #  elif defined _MSC_VER || defined __MINGW32__
+ #   define _SCN64_PREFIX "I64"
  #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
  #   define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
  #  endif
***************
*** 671,676 ****
--- 675,682 ----
  # ifdef UINT64_MAX
  #  if UINT64_MAX == ULONG_MAX
  #   define _SCNu64_PREFIX "l"
+ #  elif defined _MSC_VER || defined __MINGW32__
+ #   define _SCNu64_PREFIX "I64"
  #  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
  #   define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
  #  endif




reply via email to

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