Fix for more of https://bugs.gnu.org/68832.
* t/yacc-clean-cxx.sh: more #ifdef of yylex, etc., following
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62886,
now for OpenIndiana. Specifically:
#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
* t/yacc-cxx.sh: likewise.
* t/yacc-d-cxx.sh: likewise.
* t/yacc-mix-c-cxx.sh: likewise.
%{
// This file should contain valid C++ but invalid C.
#include <cstdio>
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C" {
+#endif
+
// "std::" qualification required by Sun C++ 5.9.
int yylex (void) { return std::getchar (); }
void yyerror (const char *s) {}
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+}
+#endif
+
%}
%%
x : 'x' { };
using std::exit;
using std::free;
using std::malloc;
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C" {
+#endif
// "std::" qualification required by Sun C++ 5.9.
int yylex (void) { return std::getchar (); }
void yyerror (const char *s) {}
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+}
+#endif
+
%}
%%
a : 'a' { exit(0); };
using std::free;
using std::malloc;
#include "$header"
+ #if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+ extern "C" {
+ #endif
int yylex (void) { return 0; }
void yyerror (const char *s) {}
+ #if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+ }
+ #endif
%}
%%
x : 'x' {};
cat > p.y <<'END'
%{
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C" {
+#endif
int yylex (void) { int new = 0; return new; }
void yyerror (const char *s) {}
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+}
+#endif
%}
%token ZARDOZ
%%
using std::free;
using std::malloc;
#include "parse.hh"
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+extern "C" {
+#endif
int yylex (void) { return 0; }
void yyerror (const char *s) {}
+#if (defined __cplusplus) && ((!defined __sun) || (defined __EXTERN_C__))
+}
+#endif
%}
%token FOOBAR
%%