From: Jim Meyering <meyering@redhat.com>
Date: Thu, 7 Oct 2010 21:15:00 +0000 (+0200)
Subject: parse-datetime: avoid compilation failure on OpenBSD 4.7
X-Git-Tag: v0.1~3710
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=9e43bb61e60a318da34628989e8a754aee18a285;p=gnulib.git

parse-datetime: avoid compilation failure on OpenBSD 4.7

* lib/parse-datetime.y (_STDLIB_H) [_STDLIB_H_]: Define.
This works around a compilation failure on OpenBSD 4.7:
http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3418
---

diff --git a/ChangeLog b/ChangeLog
index 45f2a69079..f327621a7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-10-07  Jim Meyering  <meyering@redhat.com>
+
+	parse-datetime: avoid compilation failure on OpenBSD 4.7
+	* lib/parse-datetime.y (_STDLIB_H) [_STDLIB_H_]: Define.
+	This works around a compilation failure on OpenBSD 4.7:
+	http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3418
+
 2010-10-07  Eric Blake  <eblake@redhat.com>
 
 	docs: update cygwin progress
diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index bc46e1c853..a760e69a1c 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -68,6 +68,14 @@
 
 #include "xalloc.h"
 
+/* Bison's skeleton tests _STDLIB_H, while some stdlib.h headers
+   use _STDLIB_H_ as witness.  Map the latter to the one bison uses.  */
+/* FIXME: this is temporary.  Remove when we have a mechanism to ensure
+   that the version we're using is fixed, too.  */
+#ifdef _STDLIB_H_
+# undef _STDLIB_H
+# define _STDLIB_H 1
+#endif
 
 /* ISDIGIT differs from isdigit, as follows:
    - Its arg may be any int or unsigned int; it need not be an unsigned char