From 6974762c2708dc95a7a81bc604d527e2d6f757be Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 12 May 2004 18:38:44 +0000
Subject: [PATCH] fix make parser on linux

---
 MathEval/Makefile    |  3 ++-
 MathEval/parser.h    | 19 ++++++++++++++-----
 MathEval/scanner.cpp |  2 +-
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/MathEval/Makefile b/MathEval/Makefile
index d1adf7845f..325938d08c 100644
--- a/MathEval/Makefile
+++ b/MathEval/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 2004-05-12 02:02:21 geuzaine Exp $
+# $Id: Makefile,v 1.2 2004-05-12 18:38:44 geuzaine Exp $
 #
 # Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 #
@@ -48,6 +48,7 @@ parser:
 	bison --output parser.cpp -pme -d parser.y 
 	flex -oscanner.cpp -Pme scanner.l
 	if [ -r parser.cpp.h ]; then mv parser.cpp.h parser.h ; fi
+	if [ -r parser.hpp ]; then mv parser.hpp parser.h ; fi
 
 clean:
 	rm -f *.o
diff --git a/MathEval/parser.h b/MathEval/parser.h
index 561b245ad9..8386e50466 100644
--- a/MathEval/parser.h
+++ b/MathEval/parser.h
@@ -1,11 +1,20 @@
+#ifndef BISON_PARSER_HPP
+# define BISON_PARSER_HPP
+
+#ifndef YYSTYPE
 typedef union {
   Node *node;
   Record *record;
-} YYSTYPE;
-#define	NUMBER	257
-#define	VARIABLE	258
-#define	FUNCTION	259
-#define	NEG	260
+} yystype;
+# define YYSTYPE yystype
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+# define	NUMBER	257
+# define	VARIABLE	258
+# define	FUNCTION	259
+# define	NEG	260
 
 
 extern YYSTYPE melval;
+
+#endif /* not BISON_PARSER_HPP */
diff --git a/MathEval/scanner.cpp b/MathEval/scanner.cpp
index f065663313..67e95880ad 100644
--- a/MathEval/scanner.cpp
+++ b/MathEval/scanner.cpp
@@ -20,7 +20,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /cvsroot/gmsh/MathEval/scanner.cpp,v 1.2 2004-05-12 18:14:20 geuzaine Exp $
+ * $Header: /cvsroot/gmsh/MathEval/scanner.cpp,v 1.3 2004-05-12 18:38:44 geuzaine Exp $
  */
 
 #define FLEX_SCANNER
-- 
GitLab