# HG changeset patch # User Paul Eggert # Date 1183364395 0 # Node ID 61f22d692c376a76d4e61bb19986ff2df475cc96 # Parent ce27798f1e14c87257cc625882d4797a4d8e155f * lib/inttypes_.h [defined __cplusplus&&!defined __STDC_LIMIT_MACROS]: #define __STDC_LIMIT_MACROS temporarily while including , so that __STDC_LIMIT_MACROS is defined. Problem reported by Joel E. Denny in . diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-07-02 Paul Eggert + + * lib/inttypes_.h [defined __cplusplus&&!defined __STDC_LIMIT_MACROS]: + #define __STDC_LIMIT_MACROS temporarily while including + , so that __STDC_LIMIT_MACROS is defined. + Problem reported by Joel E. Denny in + . + 2007-07-01 Bruno Haible * lib/unistdio.h: New file. diff --git a/lib/inttypes_.h b/lib/inttypes_.h --- a/lib/inttypes_.h +++ b/lib/inttypes_.h @@ -35,7 +35,17 @@ #define INTTYPES_H /* Include or the gnulib replacement. */ -#include +#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS +# include +#else +/* Macros like INT32_MIN are used below, so define __STDC_LIMIT_MACROS + while including ; this isn't namespace clean for C++, + unfortunately. */ +# define __STDC_LIMIT_MACROS +# include +# undef __STDC_LIMIT_MACROS +#endif + /* Get CHAR_BIT. */ #include