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.
# 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"
# 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"
# 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"
# 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"
-# 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,
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.
[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