From: Paul Eggert Date: Wed, 30 Nov 2005 06:24:41 +0000 (+0000) Subject: * stdint_.h (intmax_t) [defined intmax_t]: Do not declare. X-Git-Tag: cvs-readonly~2727 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=a76b7ae3e46858ff856cea39edeccad62534587f;p=gnulib.git * stdint_.h (intmax_t) [defined intmax_t]: Do not declare. (uintmax_t) [defined uintmax_t]: Do not declare. (SIZE_MAX) [defined SIZE_MAX]: Do not define. This works around a problem if intmax_t.m4 and/or uintmax_t.m4 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke. (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the sake of portability to weird hosts that C allows (though we don't know of any practical examples). --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 94df670f3..2602de844 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,5 +1,14 @@ 2005-11-29 Paul Eggert + * stdint_.h (intmax_t) [defined intmax_t]: Do not declare. + (uintmax_t) [defined uintmax_t]: Do not declare. + (SIZE_MAX) [defined SIZE_MAX]: Do not define. + This works around a problem if intmax_t.m4 and/or uintmax_t.m4 + and/or size_max.m4 are also used. Problem reported by Mark D. Baushke. + (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the + sake of portability to weird hosts that C allows (though we don't + know of any practical examples). + * savedir.h (fdsavedir): New decl. * savedir.c (fdsavedir, savedirstream): New functions; the latter contains most of the former guts of savedir. diff --git a/lib/stdint_.h b/lib/stdint_.h index ea3619d81..2d3eaffd2 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -133,11 +133,19 @@ typedef unsigned long uintptr_t; /* 7.18.1.5. Greatest-width integer types */ #ifdef _STDINT_H_HAVE_INT64 +# ifndef intmax_t typedef int64_t intmax_t; +# endif +# ifndef uintmax_t typedef uint64_t uintmax_t; +# endif #else +# ifndef intmax_t typedef int32_t intmax_t; +# endif +# ifndef uintmax_t typedef uint32_t uintmax_t; +# endif #endif /* 7.18.2. Limits of specified-width integer types */ @@ -230,7 +238,9 @@ typedef uint32_t uintmax_t; #define SIG_ATOMIC_MIN 0 #define SIG_ATOMIC_MAX 127 -#define SIZE_MAX (~(size_t)0) +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif /* wchar_t limits already defined in . */ /* wint_t limits already defined in . */