aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2011-07-09 15:03:22 -0700
committerPaul Eggert2011-07-09 15:03:22 -0700
commit3fcf7a1c80f62a8044d0e5f0132bb7065d6823b3 (patch)
treec57ccddf207f94c0ace7f603ac5a88fb6f988f06 /lib
parent972e3b728f7beced03bb337f727540c3f2c913f8 (diff)
downloademacs-3fcf7a1c80f62a8044d0e5f0132bb7065d6823b3.tar.gz
emacs-3fcf7a1c80f62a8044d0e5f0132bb7065d6823b3.zip
* lib/stdint.in.h: Merge from gnulib (Bug#9025).
This fixes a build problem on older Mac OS X hosts.
Diffstat (limited to 'lib')
-rw-r--r--lib/stdint.in.h96
1 files changed, 55 insertions, 41 deletions
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 09ac138b851..b6d08c754ae 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -270,26 +270,36 @@ typedef unsigned long int gl_uintptr_t;
270/* Note: These types are compiler dependent. It may be unwise to use them in 270/* Note: These types are compiler dependent. It may be unwise to use them in
271 public header files. */ 271 public header files. */
272 272
273#undef intmax_t 273/* If the system defines INTMAX_MAX, assume that intmax_t works, and
274#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 274 similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
275 assuming one type where another is used by the system. */
276
277#ifndef INTMAX_MAX
278# undef INTMAX_C
279# undef intmax_t
280# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
275typedef long long int gl_intmax_t; 281typedef long long int gl_intmax_t;
276# define intmax_t gl_intmax_t 282# define intmax_t gl_intmax_t
277#elif defined GL_INT64_T 283# elif defined GL_INT64_T
278# define intmax_t int64_t 284# define intmax_t int64_t
279#else 285# else
280typedef long int gl_intmax_t; 286typedef long int gl_intmax_t;
281# define intmax_t gl_intmax_t 287# define intmax_t gl_intmax_t
288# endif
282#endif 289#endif
283 290
284#undef uintmax_t 291#ifndef UINTMAX_MAX
285#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 292# undef UINTMAX_C
293# undef uintmax_t
294# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
286typedef unsigned long long int gl_uintmax_t; 295typedef unsigned long long int gl_uintmax_t;
287# define uintmax_t gl_uintmax_t 296# define uintmax_t gl_uintmax_t
288#elif defined GL_UINT64_T 297# elif defined GL_UINT64_T
289# define uintmax_t uint64_t 298# define uintmax_t uint64_t
290#else 299# else
291typedef unsigned long int gl_uintmax_t; 300typedef unsigned long int gl_uintmax_t;
292# define uintmax_t gl_uintmax_t 301# define uintmax_t gl_uintmax_t
302# endif
293#endif 303#endif
294 304
295/* Verify that intmax_t and uintmax_t have the same size. Too much code 305/* 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 441
432/* 7.18.2.5. Limits of greatest-width integer types */ 442/* 7.18.2.5. Limits of greatest-width integer types */
433 443
434#undef INTMAX_MIN 444#ifndef INTMAX_MAX
435#undef INTMAX_MAX 445# undef INTMAX_MIN
436#ifdef INT64_MAX 446# ifdef INT64_MAX
437# define INTMAX_MIN INT64_MIN 447# define INTMAX_MIN INT64_MIN
438# define INTMAX_MAX INT64_MAX 448# define INTMAX_MAX INT64_MAX
439#else 449# else
440# define INTMAX_MIN INT32_MIN 450# define INTMAX_MIN INT32_MIN
441# define INTMAX_MAX INT32_MAX 451# define INTMAX_MAX INT32_MAX
452# endif
442#endif 453#endif
443 454
444#undef UINTMAX_MAX 455#ifndef UINTMAX_MAX
445#ifdef UINT64_MAX 456# ifdef UINT64_MAX
446# define UINTMAX_MAX UINT64_MAX 457# define UINTMAX_MAX UINT64_MAX
447#else 458# else
448# define UINTMAX_MAX UINT32_MAX 459# define UINTMAX_MAX UINT32_MAX
460# endif
449#endif 461#endif
450 462
451/* 7.18.3. Limits of other integer types */ 463/* 7.18.3. Limits of other integer types */
@@ -568,22 +580,24 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
568 580
569/* 7.18.4.2. Macros for greatest-width integer constants */ 581/* 7.18.4.2. Macros for greatest-width integer constants */
570 582
571#undef INTMAX_C 583#ifndef INTMAX_C
572#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 584# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
573# define INTMAX_C(x) x##LL 585# define INTMAX_C(x) x##LL
574#elif defined GL_INT64_T 586# elif defined GL_INT64_T
575# define INTMAX_C(x) INT64_C(x) 587# define INTMAX_C(x) INT64_C(x)
576#else 588# else
577# define INTMAX_C(x) x##L 589# define INTMAX_C(x) x##L
590# endif
578#endif 591#endif
579 592
580#undef UINTMAX_C 593#ifndef UINTMAX_C
581#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 594# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
582# define UINTMAX_C(x) x##ULL 595# define UINTMAX_C(x) x##ULL
583#elif defined GL_UINT64_T 596# elif defined GL_UINT64_T
584# define UINTMAX_C(x) UINT64_C(x) 597# define UINTMAX_C(x) UINT64_C(x)
585#else 598# else
586# define UINTMAX_C(x) x##UL 599# define UINTMAX_C(x) x##UL
600# endif
587#endif 601#endif
588 602
589#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ 603#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */