bug-gnulib
[Top][All Lists]
Advanced

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

support for universal binaries on MacOS X (3/6)


From: Bruno Haible
Subject: support for universal binaries on MacOS X (3/6)
Date: Thu, 25 Dec 2008 19:40:27 +0100
User-agent: KMail/1.9.9

Same thing for <inttypes.h>.

2008-12-25  Bruno Haible  <address@hidden>

        Add support for universal builds to <inttypes.h>.
        * lib/inttypes.in.h (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX,
        _SCNu64_PREFIX): In Apple
        universal builds, define directly, using _LP64.
        * m4/inttypes.m4 (gl_INTTYPES_H): In Apple universal builds, set
        INT64_MAX_EQ_LONG_MAX and UINT64_MAX_EQ_ULONG_MAX to -1.
        * modules/inttypes (Depends-on): Add multiarch.
        (Makefile.am): Substitute APPLE_UNIVERSAL_BUILD.

*** lib/inttypes.in.h.orig      2008-12-25 19:33:39.000000000 +0100
--- lib/inttypes.in.h   2008-12-25 14:54:21.000000000 +0100
***************
*** 168,174 ****
  #  endif
  # endif
  # ifdef INT64_MAX
! #  if @INT64_MAX_EQ_LONG_MAX@
  #   define _PRI64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _PRI64_PREFIX "I64"
--- 168,174 ----
  #  endif
  # endif
  # ifdef INT64_MAX
! #  if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @INT64_MAX_EQ_LONG_MAX@)
  #   define _PRI64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _PRI64_PREFIX "I64"
***************
*** 185,191 ****
  #  endif
  # endif
  # ifdef UINT64_MAX
! #  if @UINT64_MAX_EQ_ULONG_MAX@
  #   define _PRIu64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _PRIu64_PREFIX "I64"
--- 185,191 ----
  #  endif
  # endif
  # ifdef UINT64_MAX
! #  if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
  #   define _PRIu64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _PRIu64_PREFIX "I64"
***************
*** 661,667 ****
  #  endif
  # endif
  # ifdef INT64_MAX
! #  if @INT64_MAX_EQ_LONG_MAX@
  #   define _SCN64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _SCN64_PREFIX "I64"
--- 661,667 ----
  #  endif
  # endif
  # ifdef INT64_MAX
! #  if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @INT64_MAX_EQ_LONG_MAX@)
  #   define _SCN64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _SCN64_PREFIX "I64"
***************
*** 678,684 ****
  #  endif
  # endif
  # ifdef UINT64_MAX
! #  if @UINT64_MAX_EQ_ULONG_MAX@
  #   define _SCNu64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _SCNu64_PREFIX "I64"
--- 678,684 ----
  #  endif
  # endif
  # ifdef UINT64_MAX
! #  if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
  #   define _SCNu64_PREFIX "l"
  #  elif defined _MSC_VER || defined __MINGW32__
  #   define _SCNu64_PREFIX "I64"
*** m4/inttypes.m4.orig 2008-12-25 19:33:39.000000000 +0100
--- m4/inttypes.m4      2008-12-25 19:09:17.000000000 +0100
***************
*** 1,4 ****
! # inttypes.m4 serial 12
  dnl Copyright (C) 2006-2008 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 ----
! # inttypes.m4 serial 13
  dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 144,149 ****
--- 144,151 ----
      AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
      gl_CHECK_NEXT_HEADERS([inttypes.h])
  
+     AC_REQUIRE([gl_MULTIARCH])
+ 
      dnl Ensure that <stdint.h> defines the limit macros, since gnulib's
      dnl <inttypes.h> relies on them.  This macro is only needed when a
      dnl C++ compiler is in use; it has no effect for a C compiler.
***************
*** 212,232 ****
        [defined INT32_MAX && defined INTMAX_MAX],
        [INT32_MAX < INTMAX_MAX],
        [sizeof (int) < sizeof (long long int)])
!     gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
!       [INT64_MAX_EQ_LONG_MAX],
!       [defined INT64_MAX],
!       [INT64_MAX == LONG_MAX],
!       [sizeof (long long int) == sizeof (long int)])
      gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
        [UINT32_MAX_LT_UINTMAX_MAX],
        [defined UINT32_MAX && defined UINTMAX_MAX],
        [UINT32_MAX < UINTMAX_MAX],
        [sizeof (unsigned int) < sizeof (unsigned long long int)])
!     gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
!       [UINT64_MAX_EQ_ULONG_MAX],
!       [defined UINT64_MAX],
!       [UINT64_MAX == ULONG_MAX],
!       [sizeof (unsigned long long int) == sizeof (unsigned long int)])
  
      INTTYPES_H='inttypes.h'
    fi
--- 214,242 ----
        [defined INT32_MAX && defined INTMAX_MAX],
        [INT32_MAX < INTMAX_MAX],
        [sizeof (int) < sizeof (long long int)])
!     if test $APPLE_UNIVERSAL_BUILD = 0; then
!       gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
!         [INT64_MAX_EQ_LONG_MAX],
!         [defined INT64_MAX],
!         [INT64_MAX == LONG_MAX],
!         [sizeof (long long int) == sizeof (long int)])
!     else
!       INT64_MAX_EQ_LONG_MAX=-1
!     fi
      gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
        [UINT32_MAX_LT_UINTMAX_MAX],
        [defined UINT32_MAX && defined UINTMAX_MAX],
        [UINT32_MAX < UINTMAX_MAX],
        [sizeof (unsigned int) < sizeof (unsigned long long int)])
!     if test $APPLE_UNIVERSAL_BUILD = 0; then
!       gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
!         [UINT64_MAX_EQ_ULONG_MAX],
!         [defined UINT64_MAX],
!         [UINT64_MAX == ULONG_MAX],
!         [sizeof (unsigned long long int) == sizeof (unsigned long int)])
!     else
!       UINT64_MAX_EQ_ULONG_MAX=-1
!     fi
  
      INTTYPES_H='inttypes.h'
    fi
*** modules/inttypes.orig       2008-12-25 19:33:39.000000000 +0100
--- modules/inttypes    2008-12-25 19:07:35.000000000 +0100
***************
*** 9,14 ****
--- 9,15 ----
  Depends-on:
  include_next
  link-warning
+ multiarch
  stdint
  
  configure.ac:
***************
*** 27,32 ****
--- 28,34 ----
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
              -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
+             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
              -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
              -e 
's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
              -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \





reply via email to

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