Commit 3fcf7a1c authored by Paul Eggert's avatar Paul Eggert

* lib/stdint.in.h: Merge from gnulib (Bug#9025).

This fixes a build problem on older Mac OS X hosts.
parent 972e3b72
2011-07-09 Paul Eggert <eggert@cs.ucla.edu> 2011-07-09 Paul Eggert <eggert@cs.ucla.edu>
* lib/stdint.in.h: Merge from gnulib (Bug#9025).
This fixes a build problem on older Mac OS X hosts.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Omit gl_THREADLIB * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Omit gl_THREADLIB
test, which runs afoul of Automake installations where, for example, test, which runs afoul of Automake installations where, for example,
/usr/share/aclocal contains a copy of gl_THREADLIB. /usr/share/aclocal contains a copy of gl_THREADLIB.
......
...@@ -270,26 +270,36 @@ typedef unsigned long int gl_uintptr_t; ...@@ -270,26 +270,36 @@ typedef unsigned long int gl_uintptr_t;
/* Note: These types are compiler dependent. It may be unwise to use them in /* Note: These types are compiler dependent. It may be unwise to use them in
public header files. */ public header files. */
#undef intmax_t /* If the system defines INTMAX_MAX, assume that intmax_t works, and
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
assuming one type where another is used by the system. */
#ifndef INTMAX_MAX
# undef INTMAX_C
# undef intmax_t
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
typedef long long int gl_intmax_t; typedef long long int gl_intmax_t;
# define intmax_t gl_intmax_t # define intmax_t gl_intmax_t
#elif defined GL_INT64_T # elif defined GL_INT64_T
# define intmax_t int64_t # define intmax_t int64_t
#else # else
typedef long int gl_intmax_t; typedef long int gl_intmax_t;
# define intmax_t gl_intmax_t # define intmax_t gl_intmax_t
# endif
#endif #endif
#undef uintmax_t #ifndef UINTMAX_MAX
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # undef UINTMAX_C
# undef uintmax_t
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
typedef unsigned long long int gl_uintmax_t; typedef unsigned long long int gl_uintmax_t;
# define uintmax_t gl_uintmax_t # define uintmax_t gl_uintmax_t
#elif defined GL_UINT64_T # elif defined GL_UINT64_T
# define uintmax_t uint64_t # define uintmax_t uint64_t
#else # else
typedef unsigned long int gl_uintmax_t; typedef unsigned long int gl_uintmax_t;
# define uintmax_t gl_uintmax_t # define uintmax_t gl_uintmax_t
# endif
#endif #endif
/* Verify that intmax_t and uintmax_t have the same size. Too much code /* Verify that intmax_t and uintmax_t have the same size. Too much code
...@@ -431,21 +441,23 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) ...@@ -431,21 +441,23 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
/* 7.18.2.5. Limits of greatest-width integer types */ /* 7.18.2.5. Limits of greatest-width integer types */
#undef INTMAX_MIN #ifndef INTMAX_MAX
#undef INTMAX_MAX # undef INTMAX_MIN
#ifdef INT64_MAX # ifdef INT64_MAX
# define INTMAX_MIN INT64_MIN # define INTMAX_MIN INT64_MIN
# define INTMAX_MAX INT64_MAX # define INTMAX_MAX INT64_MAX
#else # else
# define INTMAX_MIN INT32_MIN # define INTMAX_MIN INT32_MIN
# define INTMAX_MAX INT32_MAX # define INTMAX_MAX INT32_MAX
# endif
#endif #endif
#undef UINTMAX_MAX #ifndef UINTMAX_MAX
#ifdef UINT64_MAX # ifdef UINT64_MAX
# define UINTMAX_MAX UINT64_MAX # define UINTMAX_MAX UINT64_MAX
#else # else
# define UINTMAX_MAX UINT32_MAX # define UINTMAX_MAX UINT32_MAX
# endif
#endif #endif
/* 7.18.3. Limits of other integer types */ /* 7.18.3. Limits of other integer types */
...@@ -568,22 +580,24 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) ...@@ -568,22 +580,24 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
/* 7.18.4.2. Macros for greatest-width integer constants */ /* 7.18.4.2. Macros for greatest-width integer constants */
#undef INTMAX_C #ifndef INTMAX_C
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define INTMAX_C(x) x##LL # define INTMAX_C(x) x##LL
#elif defined GL_INT64_T # elif defined GL_INT64_T
# define INTMAX_C(x) INT64_C(x) # define INTMAX_C(x) INT64_C(x)
#else # else
# define INTMAX_C(x) x##L # define INTMAX_C(x) x##L
# endif
#endif #endif
#undef UINTMAX_C #ifndef UINTMAX_C
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
# define UINTMAX_C(x) x##ULL # define UINTMAX_C(x) x##ULL
#elif defined GL_UINT64_T # elif defined GL_UINT64_T
# define UINTMAX_C(x) UINT64_C(x) # define UINTMAX_C(x) UINT64_C(x)
#else # else
# define UINTMAX_C(x) x##UL # define UINTMAX_C(x) x##UL
# endif
#endif #endif
#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment