From: Akim Demaille Date: Fri, 27 Jul 2012 14:36:07 +0000 (+0200) Subject: tests: do not depend on __cplusplus to decide for C++ or C output X-Git-Tag: v2.6.1~3 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/4acc22e5cf47432cec8e196f6f1fefb43453f3b5?ds=inline tests: do not depend on __cplusplus to decide for C++ or C output Since we do support compiling C code with a C++ compiler. * tests/actions.at (Qualified $$ in actions): Use AT_SKEL_CC_IF. --- diff --git a/tests/actions.at b/tests/actions.at index 8232a007..1ec8ef9a 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -1257,8 +1257,6 @@ AT_DATA_GRAMMAR([[input.y]], %debug %code requires { -# include - 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 static void report (std::ostream& yyo, int ival, float fval) { yyo << "ival: " << ival << ", fval: " << fval; } -#else +]], [[ +# include static void report (FILE* yyo, int ival, float fval) { fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); } -#endif +]])[ } %code