[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
support for universal binaries on MacOS X (2/6)
From: |
Bruno Haible |
Subject: |
support for universal binaries on MacOS X (2/6) |
Date: |
Thu, 25 Dec 2008 19:33:14 +0100 |
User-agent: |
KMail/1.9.9 |
This patch makes a single generated <stdint.h> work for both 32-bit and 64-bit
builds simultaneously.
2008-12-25 Bruno Haible <address@hidden>
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.
* m4/stdint.m4 (gl_STDINT_TYPE_PROPERTIES): Require gl_MULTIARCH. In
Apple universal builds, don't test for the size and suffix of ptrdiff_t
and size_t.
* modules/stdint (Depends-on): Add multiarch.
(Makefile.am): Substitute APPLE_UNIVERSAL_BUILD.
*** lib/stdint.in.h.orig 2008-12-25 19:27:05.000000000 +0100
--- lib/stdint.in.h 2008-12-25 18:59:38.000000000 +0100
***************
*** 443,452 ****
/* ptrdiff_t limits */
#undef PTRDIFF_MIN
#undef PTRDIFF_MAX
! #define PTRDIFF_MIN \
! _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
! #define PTRDIFF_MAX \
! _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
/* sig_atomic_t limits */
#undef SIG_ATOMIC_MIN
--- 443,462 ----
/* ptrdiff_t limits */
#undef PTRDIFF_MIN
#undef PTRDIFF_MAX
! #if @APPLE_UNIVERSAL_BUILD@
! # if _LP64
! # define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
! # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
! # else
! # define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
! # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
! # endif
! #else
! # define PTRDIFF_MIN \
! _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
! # define PTRDIFF_MAX \
! _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
! #endif
/* sig_atomic_t limits */
#undef SIG_ATOMIC_MIN
***************
*** 461,467 ****
/* size_t limit */
#undef SIZE_MAX
! #define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
/* wchar_t limits */
#undef WCHAR_MIN
--- 471,485 ----
/* size_t limit */
#undef SIZE_MAX
! #if @APPLE_UNIVERSAL_BUILD@
! # if _LP64
! # define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
! # else
! # define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
! # endif
! #else
! # define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
! #endif
/* wchar_t limits */
#undef WCHAR_MIN
*** m4/stdint.m4.orig 2008-12-25 19:27:05.000000000 +0100
--- m4/stdint.m4 2008-12-25 19:09:05.000000000 +0100
***************
*** 1,4 ****
! # stdint.m4 serial 31
dnl Copyright (C) 2001-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 ----
! # stdint.m4 serial 32
dnl Copyright (C) 2001-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,
***************
*** 373,385 ****
dnl of interest to stdint.in.h.
AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
[
! gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_cv_type_ptrdiff_t_signed=yes
gl_cv_type_size_t_signed=no
! gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
])
--- 373,394 ----
dnl of interest to stdint.in.h.
AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
[
! AC_REQUIRE([gl_MULTIARCH])
! if test $APPLE_UNIVERSAL_BUILD = 0; then
! gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
! [gl_STDINT_INCLUDES])
! fi
! gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_cv_type_ptrdiff_t_signed=yes
gl_cv_type_size_t_signed=no
! if test $APPLE_UNIVERSAL_BUILD = 0; then
! gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
! [gl_STDINT_INCLUDES])
! fi
! gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
])
*** modules/stdint.orig 2008-12-25 19:27:05.000000000 +0100
--- modules/stdint 2008-12-25 19:07:23.000000000 +0100
***************
*** 13,18 ****
--- 13,19 ----
Depends-on:
include_next
+ multiarch
wchar
configure.ac:
***************
*** 36,41 ****
--- 37,43 ----
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/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/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
-e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- support for universal binaries on MacOS X (2/6),
Bruno Haible <=