Mercurial > hg > octave-lyh > gnulib-hg
changeset 10972:cf1b1ca0bb08
Add support for universal builds to <inttypes.h>.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 25 Dec 2008 19:40:14 +0100 |
parents | 64a20f26c6bd |
children | e1a3422c4e90 |
files | ChangeLog lib/inttypes.in.h m4/inttypes.m4 modules/inttypes |
diffstat | 4 files changed, 36 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-12-25 Bruno Haible <bruno@clisp.org> + 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. + Add support for universal builds to <stdint.h>. * lib/stdint.in.h (PDFDIFF_MIN, PTRDIFF_MAX, SIZE_MAX): In Apple universal builds, define directly, using _LP64.
--- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -168,7 +168,7 @@ # endif # endif # ifdef INT64_MAX -# if @INT64_MAX_EQ_LONG_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,7 +185,7 @@ # endif # endif # ifdef UINT64_MAX -# if @UINT64_MAX_EQ_ULONG_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,7 +661,7 @@ # endif # endif # ifdef INT64_MAX -# if @INT64_MAX_EQ_LONG_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,7 +678,7 @@ # endif # endif # ifdef UINT64_MAX -# if @UINT64_MAX_EQ_ULONG_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"
--- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 12 +# 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,6 +144,8 @@ 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,21 +214,29 @@ [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)]) + 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)]) - 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)]) + 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
--- a/modules/inttypes +++ b/modules/inttypes @@ -9,6 +9,7 @@ Depends-on: include_next link-warning +multiarch stdint configure.ac: @@ -27,6 +28,7 @@ -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' \