bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inttypes.h error for Bison


From: Paul Eggert
Subject: Re: inttypes.h error for Bison
Date: Mon, 02 Jul 2007 01:21:39 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

"Joel E. Denny" <address@hidden> writes:

> Thanks.  Could Gnulib's lib/stdint_.h define __STDC_LIMIT_MACROS for C++?

That sounds like the simplest workaround, for now anyway.  I installed
this into gnulib.  I can think of more complicated but namespace-clean
fixes but I'm not sure they're worth the bother.

2007-07-02  Paul Eggert  <address@hidden>

        * lib/inttypes_.h [defined __cplusplus&&!defined __STDC_LIMIT_MACROS]:
        #define __STDC_LIMIT_MACROS temporarily while including
        <stdint.h>, so that __STDC_LIMIT_MACROS is defined.
        Problem reported by Joel E. Denny in
        <http://lists.gnu.org/archive/html/bug-gnulib/2007-07/msg00008.html>.

--- lib/inttypes_.h     21 Jun 2007 04:39:10 -0000      1.13
+++ lib/inttypes_.h     2 Jul 2007 08:19:51 -0000
@@ -35,7 +35,17 @@
 #define INTTYPES_H

 /* Include <stdint.h> or the gnulib replacement.  */
-#include <stdint.h>
+#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
+# include <stdint.h>
+#else
+/* Macros like INT32_MIN are used below, so define __STDC_LIMIT_MACROS
+   while including <stdint.h>; this isn't namespace clean for C++,
+   unfortunately.  */
+# define __STDC_LIMIT_MACROS
+# include <stdint.h>
+# undef __STDC_LIMIT_MACROS
+#endif
+
 /* Get CHAR_BIT.  */
 #include <limits.h>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]