[augeas-devel] [PATCH 6 of 7] Work around a problem with Bison on FreeBSD
David Lutterkort
dlutter at redhat.com
Thu May 29 23:56:48 UTC 2008
1 file changed, 9 insertions(+)
src/parser.y | 9 +++++++++
# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1212104951 25200
# Node ID 1278209b8324592f6e16115186e88d77bd9acfc0
# Parent 010976c03f1efb044e31c5b4b1c5db3fd8572faf
Work around a problem with Bison on FreeBSD
Bison looks for _STDLIB_H to see if stdlib.h has been included, but the
system includes use _STDLIB_H_; that makes Bison think malloc/free have not
been declared yet and it goes and does that. gcc then complains about the
duplicate declaration.
diff -r 010976c03f1e -r 1278209b8324 src/parser.y
--- a/src/parser.y Thu May 29 16:47:35 2008 -0700
+++ b/src/parser.y Thu May 29 16:49:11 2008 -0700
@@ -6,6 +6,15 @@
#include "syntax.h"
#include "list.h"
#include <stdio.h>
+
+/* Work around a problem on FreeBSD where Bison looks for _STDLIB_H
+ * to see if stdlib.h has been included, but the system includes
+ * use _STDLIB_H_
+ */
+#if HAVE_STDLIB_H && ! defined _STDLIB_H
+# include <stdlib.h>
+# define _STDLIB_H 1
+#endif
#define YYDEBUG 1
More information about the augeas-devel
mailing list