automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: test: protect more yacc declara


From: Karl Berry
Subject: [automake-commit] branch master updated: test: protect more yacc declarations against C vs. C++ linkage.
Date: Wed, 07 Feb 2024 17:56:36 -0500

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=efb9f7b298cc45e0663874b34379f618b092f2fd

The following commit(s) were added to refs/heads/master by this push:
     new efb9f7b29 test: protect more yacc declarations against C vs. C++ 
linkage.
efb9f7b29 is described below

commit efb9f7b298cc45e0663874b34379f618b092f2fd
Author: Bogdan <bogdro_rep@gmx.us>
AuthorDate: Wed Feb 7 14:56:25 2024 -0800

    test: protect more yacc declarations against C vs. C++ linkage.
    
    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.
---
 t/yacc-clean-cxx.sh |  8 ++++++++
 t/yacc-cxx.sh       |  7 +++++++
 t/yacc-d-cxx.sh     |  6 ++++++
 t/yacc-mix-c-cxx.sh | 12 ++++++++++++
 4 files changed, 33 insertions(+)

diff --git a/t/yacc-clean-cxx.sh b/t/yacc-clean-cxx.sh
index facd6dbc4..6af2047c0 100644
--- a/t/yacc-clean-cxx.sh
+++ b/t/yacc-clean-cxx.sh
@@ -70,9 +70,17 @@ cat > sub1/parsefoo.yxx << 'END'
 %{
 // 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' { };
diff --git a/t/yacc-cxx.sh b/t/yacc-cxx.sh
index f6b477c0d..3f891dac5 100644
--- a/t/yacc-cxx.sh
+++ b/t/yacc-cxx.sh
@@ -54,9 +54,16 @@ cat > parse1.yy << 'END'
 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); };
diff --git a/t/yacc-d-cxx.sh b/t/yacc-d-cxx.sh
index 255e00a71..556977c22 100644
--- a/t/yacc-d-cxx.sh
+++ b/t/yacc-d-cxx.sh
@@ -35,8 +35,14 @@ write_parse ()
     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' {};
diff --git a/t/yacc-mix-c-cxx.sh b/t/yacc-mix-c-cxx.sh
index 0e7e2e104..d454fe244 100644
--- a/t/yacc-mix-c-cxx.sh
+++ b/t/yacc-mix-c-cxx.sh
@@ -54,8 +54,14 @@ END
 
 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
 %%
@@ -93,8 +99,14 @@ using std::exit;
 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
 %%



reply via email to

[Prev in Thread] Current Thread [Next in Thread]