| @@ -1,26 +1,52 @@ | | | @@ -1,26 +1,52 @@ |
1 | $NetBSD: patch-tools_mkmake_mkmake.y,v 1.2 2015/11/07 23:47:52 dholland Exp $ | | 1 | $NetBSD: patch-tools_mkmake_mkmake.y,v 1.3 2020/02/18 16:47:20 joerg Exp $ |
2 | | | 2 | |
3 | - use standard headers | | 3 | - use standard headers |
4 | - avoid symbol name collision on OpenBSD where clock() from time.h leaks in | | 4 | - avoid symbol name collision on OpenBSD where clock() from time.h leaks in |
| | | 5 | - YYDEBUG is always defined in newer byacc versions, so check for non-0 |
| | | 6 | value instead |
5 | | | 7 | |
6 | --- tools/mkmake/mkmake.y.orig 2010-01-17 18:00:07.000000000 +0000 | | 8 | --- tools/mkmake/mkmake.y.orig 2010-01-17 18:00:07.000000000 +0000 |
7 | +++ tools/mkmake/mkmake.y | | 9 | +++ tools/mkmake/mkmake.y |
8 | @@ -40,6 +40,7 @@ __RCSID("$NetBSD: mkmake.y,v 1.1.1.1 201 | | 10 | @@ -40,6 +40,7 @@ __RCSID("$NetBSD: mkmake.y,v 1.1.1.1 201 |
9 | #endif | | 11 | #endif |
10 | #endif /* not lint */ | | 12 | #endif /* not lint */ |
11 | #endif | | 13 | #endif |
12 | +#include <stdlib.h> | | 14 | +#include <stdlib.h> |
13 | | | 15 | |
14 | typedef struct string { | | 16 | typedef struct string { |
15 | int | | 17 | int |
16 | @@ -308,6 +309,10 @@ white_space : WHITE_SPACE | | 18 | @@ -308,6 +309,10 @@ white_space : WHITE_SPACE |
17 | #include <string.h> | | 19 | #include <string.h> |
18 | #include <ctype.h> | | 20 | #include <ctype.h> |
19 | | | 21 | |
20 | +/* work around symbol collision on OpenBSD */ | | 22 | +/* work around symbol collision on OpenBSD */ |
21 | +#undef clock | | 23 | +#undef clock |
22 | +#define clock Clock | | 24 | +#define clock Clock |
23 | + | | 25 | + |
24 | /* mkmake.y */ | | 26 | /* mkmake.y */ |
25 | void yyerror(char *); | | 27 | void yyerror(char *); |
26 | void assign(same_t *, same_t *); | | 28 | void assign(same_t *, same_t *); |
| | | 29 | @@ -957,7 +962,7 @@ yylex() |
| | | 30 | return token_type(buffer); \ |
| | | 31 | } |
| | | 32 | #define save(c) { last_char = c; last_saved = 1; } |
| | | 33 | -#if defined(YYDEBUG) |
| | | 34 | +#if YYDEBUG - 0 |
| | | 35 | #define Return(y,c) if (yydebug) { \ |
| | | 36 | printf("[%d]", c); \ |
| | | 37 | fflush(stdout); \ |
| | | 38 | @@ -1096,12 +1101,14 @@ do_dump() |
| | | 39 | string_t *string; |
| | | 40 | same_t *same, *same2; |
| | | 41 | |
| | | 42 | +#if YYDEBUG - 0 |
| | | 43 | if (yydebug > 1) { |
| | | 44 | printf("strings...\n"); |
| | | 45 | for (string = strings; string; string = string->next) { |
| | | 46 | printf("\t%s\n", string->string); |
| | | 47 | } |
| | | 48 | } |
| | | 49 | +#endif |
| | | 50 | |
| | | 51 | printf("# variables...\n"); |
| | | 52 | for (visit(variables, same); !visited(same); visit_next(same)) { |