mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
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.
This commit is contained in:
@@ -1257,8 +1257,6 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
%debug
|
%debug
|
||||||
%code requires
|
%code requires
|
||||||
{
|
{
|
||||||
# include <stdio.h>
|
|
||||||
|
|
||||||
typedef struct sem_type
|
typedef struct sem_type
|
||||||
{
|
{
|
||||||
int ival;
|
int ival;
|
||||||
@@ -1267,20 +1265,21 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
|
|
||||||
# define YYSTYPE sem_type
|
# define YYSTYPE sem_type
|
||||||
|
|
||||||
#ifdef __cplusplus
|
]AT_SKEL_CC_IF([[
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
static void
|
static void
|
||||||
report (std::ostream& yyo, int ival, float fval)
|
report (std::ostream& yyo, int ival, float fval)
|
||||||
{
|
{
|
||||||
yyo << "ival: " << ival << ", fval: " << fval;
|
yyo << "ival: " << ival << ", fval: " << fval;
|
||||||
}
|
}
|
||||||
#else
|
]], [[
|
||||||
|
# include <stdio.h>
|
||||||
static void
|
static void
|
||||||
report (FILE* yyo, int ival, float fval)
|
report (FILE* yyo, int ival, float fval)
|
||||||
{
|
{
|
||||||
fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
|
fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
|
||||||
}
|
}
|
||||||
#endif
|
]])[
|
||||||
}
|
}
|
||||||
|
|
||||||
%code
|
%code
|
||||||
|
|||||||
Reference in New Issue
Block a user