diff options
author | obrien <obrien@FreeBSD.org> | 1999-10-28 15:18:05 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-10-28 15:18:05 +0000 |
commit | 811b0ef57d4e660d1ccab9ca0b2defbb5a45cf55 (patch) | |
tree | eb0ba8748142ec214e42fb47077be77854178a19 /usr.bin/yacc | |
parent | b0d0f86853e501f4aa4b2d14e241f009b51dd1e0 (diff) | |
download | FreeBSD-src-811b0ef57d4e660d1ccab9ca0b2defbb5a45cf55.zip FreeBSD-src-811b0ef57d4e660d1ccab9ca0b2defbb5a45cf55.tar.gz |
Make "YYPARSE_PARAM" and "YYPARSE_PARAM_TYPE" C++/ANSI-C clean.
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r-- | usr.bin/yacc/skeleton.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c index 90235cb..1eb07df 100644 --- a/usr.bin/yacc/skeleton.c +++ b/usr.bin/yacc/skeleton.c @@ -161,16 +161,27 @@ char *body[] = "", "#ifndef YYPARSE_PARAM", "#define YYPARSE_PARAM", - "#define YYPARSE_PARAM_DECL", - "#else", + "#if defined(__cplusplus) || __STDC__", + "#define YYPARSE_PARAM_TYPE void", + "#else /* ! ANSI-C/C++ */", + "#define YYPARSE_PARAM_TYPE", + "#endif /* ANSI-C/C++ */", + "#else /* ! YYPARSE_PARAM */", "#ifndef YYPARSE_PARAM_TYPE", "#define YYPARSE_PARAM_TYPE void *", "#endif", + "#endif /* ! YYPARSE_PARAM */", + "", + "#if defined(__cplusplus) || __STDC__", + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM", + "#define YYPARSE_PARAM_DECL", + "#else /* ! ANSI-C/C++ */", + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM;", "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;", - "#endif", + "#endif /* ANSI-C/C++ */", "", "int", - "yyparse (YYPARSE_PARAM)", + "yyparse (YYPARSE_PARAM_ARG)", " YYPARSE_PARAM_DECL", "{", " register int yym, yyn, yystate;", |