From 4bd3fef6f7018a0092c02aeba61af43265d12ceb Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Mon, 22 Apr 2013 13:29:33 -0700
Subject: MAINT-2612 fix issues between extern C linkage and yyval ifdefs on
 Mac with toolchain > 4.5.1

---
 indra/lscript/lscript_compile/indra.l | 8 +++++++-
 indra/lscript/lscript_compile/indra.y | 6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 0d93f5cba2..ab0d31ec46 100644
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -79,11 +79,17 @@ void parse_string();
 #define yyfree indra_free
 
 
+#if LL_DARWIN
+int yyparse( void );
+int yylex( void );
+int yyerror(const char *fmt, ...);
+#else
 #if defined(__cplusplus)
-extern "C" { int yylex( void ); }
 extern "C" { int yyparse( void ); }
+extern "C" { int yylex( void ); }
 extern "C" { int yyerror(const char *fmt, ...); }
 #endif
+#endif
 
 %}
 
diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y
index e4b10ffdd9..8df0e8ad83 100644
--- a/indra/lscript/lscript_compile/indra.y
+++ b/indra/lscript/lscript_compile/indra.y
@@ -2,8 +2,10 @@
 	#include "linden_common.h"
 	#include "lscript_tree.h"
 
-    #ifdef __cplusplus
+    #if !LL_DARWIN
+    #ifdef __cplusplus 
     extern "C" {
+    #endif
     #endif
 
 	int yylex(void);
@@ -20,9 +22,11 @@
 	#pragma warning( disable : 4065 )	// warning: switch statement contains 'default' but no 'case' labels
 	#endif
 
+    #if !LL_DARWIN
     #ifdef __cplusplus
     }
     #endif
+    #endif
 %}
 
 %union
-- 
cgit v1.2.3