This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFA] bfd vs stdbool.h
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 29 Jan 2002 11:23:44 -0500
- Subject: [RFA] bfd vs stdbool.h
I described this problem a week or two ago and finally got around to fixing
it. Is this patch OK?
Only compile-tested on i386-linux. Previously broken because my
/usr/include/curses.h includes <stdbool.h> too.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-01-29 Daniel Jacobowitz <drow@mvista.com>
* bfd-in.h: Include <stdbool.h> if it is available.
* bfd-in2.h: Regenerated.
Index: bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.38
diff -u -r1.38 bfd-in.h
--- bfd-in.h 2001/12/22 17:18:34 1.38
+++ bfd-in.h 2002/01/29 16:20:27
@@ -88,8 +88,15 @@
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
/* It gets worse if the host also defines a true/false enum... -sts */
/* And even worse if your compiler has built-in boolean types... -law */
+/* And even worse if your compiler provides a stdbool.h that conflicts
+ with these definitions... gcc 2.95 and later do. -drow */
#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
#define TRUE_FALSE_ALREADY_DEFINED
+#else
+#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
+#include <stdbool.h>
+#define TRUE_FALSE_ALREADY_DEFINED
+#endif
#endif
#ifdef MPW
/* Pre-emptive strike - get the file with the enum. */
Index: bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.136
diff -u -r1.136 bfd-in2.h
--- bfd-in2.h 2002/01/06 07:30:35 1.136
+++ bfd-in2.h 2002/01/29 16:20:27
@@ -94,8 +94,15 @@
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
/* It gets worse if the host also defines a true/false enum... -sts */
/* And even worse if your compiler has built-in boolean types... -law */
+/* And even worse if your compiler provides a stdbool.h that conflicts
+ with these definitions... gcc 2.95 and later do. -drow */
#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
#define TRUE_FALSE_ALREADY_DEFINED
+#else
+#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
+#include <stdbool.h>
+#define TRUE_FALSE_ALREADY_DEFINED
+#endif
#endif
#ifdef MPW
/* Pre-emptive strike - get the file with the enum. */