Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/yacc In the generated C file, don't assume that <sys...
details: https://anonhg.NetBSD.org/src/rev/1cc08ce582bb
branches: trunk
changeset: 521516:1cc08ce582bb
user: tv <tv%NetBSD.org@localhost>
date: Thu Jan 31 21:01:15 2002 +0000
description:
In the generated C file, don't assume that <sys/cdefs.h> exists. Instead,
imply it with the <stdlib.h> include already present in the file, and
provide a compatibility definition for __P().
diffstat:
usr.bin/yacc/skeleton.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diffs (45 lines):
diff -r fb38d349e1fc -r 1cc08ce582bb usr.bin/yacc/skeleton.c
--- a/usr.bin/yacc/skeleton.c Thu Jan 31 20:15:14 2002 +0000
+++ b/usr.bin/yacc/skeleton.c Thu Jan 31 21:01:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: skeleton.c,v 1.22 2002/01/30 20:37:59 tv Exp $ */
+/* $NetBSD: skeleton.c,v 1.23 2002/01/31 21:01:15 tv Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)skeleton.c 5.8 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: skeleton.c,v 1.22 2002/01/30 20:37:59 tv Exp $");
+__RCSID("$NetBSD: skeleton.c,v 1.23 2002/01/31 21:01:15 tv Exp $");
#endif /* 0 */
#endif /* not lint */
@@ -61,17 +61,23 @@
const char * const banner[] =
{
- "#include <sys/cdefs.h>",
+ "#include <stdlib.h>",
"#ifndef lint",
"#if 0",
"static char yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";",
"#else",
"#if defined(__NetBSD__) && defined(__IDSTRING)",
- "__IDSTRING(yyrcsid, \"$NetBSD: skeleton.c,v 1.22 2002/01/30 20:37:59 tv Exp $\");",
+ "__IDSTRING(yyrcsid, \"$NetBSD: skeleton.c,v 1.23 2002/01/31 21:01:15 tv Exp $\");",
"#endif /* __NetBSD__ && __IDSTRING */",
"#endif /* 0 */",
"#endif /* lint */",
- "#include <stdlib.h>",
+ "#ifndef __P",
+ "#ifdef __STDC__",
+ "#define __P(x) x",
+ "#else",
+ "#define __P(x) ()",
+ "#endif",
+ "#endif",
"#define YYBYACC 1",
"#define YYMAJOR 1",
"#define YYMINOR 9",
Home |
Main Index |
Thread Index |
Old Index