]> git.saurik.com Git - bison.git/commitdiff
tests: do not depend on __cplusplus to decide for C++ or C output
authorAkim Demaille <akim@lrde.epita.fr>
Fri, 27 Jul 2012 14:36:07 +0000 (16:36 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 27 Jul 2012 14:36:07 +0000 (16:36 +0200)
Since we do support compiling C code with a C++ compiler.

* tests/actions.at (Qualified $$ in actions): Use AT_SKEL_CC_IF.

tests/actions.at

index 8232a00780284ddd523eb1ee6d104836ce391b0c..1ec8ef9ae408401e4a23ed05bf617c2329bb7f21 100644 (file)
@@ -1257,8 +1257,6 @@ AT_DATA_GRAMMAR([[input.y]],
 %debug
 %code requires
 {
-# include <stdio.h>
-
   typedef struct sem_type
   {
     int ival;
@@ -1267,20 +1265,21 @@ AT_DATA_GRAMMAR([[input.y]],
 
 # define YYSTYPE sem_type
 
-#ifdef __cplusplus
+]AT_SKEL_CC_IF([[
 # include <iostream>
   static void
   report (std::ostream& yyo, int ival, float fval)
   {
     yyo << "ival: " << ival << ", fval: " <<  fval;
   }
-#else
+]], [[
+# include <stdio.h>
   static void
   report (FILE* yyo, int ival, float fval)
   {
     fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
   }
-#endif
+]])[
 }
 
 %code