diff options
Diffstat (limited to 'contrib/byacc/defs.h')
-rw-r--r-- | contrib/byacc/defs.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/contrib/byacc/defs.h b/contrib/byacc/defs.h index 7be5748..4d1a407 100644 --- a/contrib/byacc/defs.h +++ b/contrib/byacc/defs.h @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.36 2011/12/20 01:31:16 tom Exp $ */ +/* $Id: defs.h,v 1.37 2012/05/26 15:23:00 tom Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -11,6 +11,10 @@ #include <ctype.h> #include <stdio.h> +#if defined(__cplusplus) /* __cplusplus, etc. */ +#define class myClass +#endif + #define YYMAJOR 1 #define YYMINOR 9 @@ -132,9 +136,11 @@ #define CALLOC(k,n) (calloc((size_t)(k),(size_t)(n))) #define FREE(x) (free((char*)(x))) #define MALLOC(n) (malloc((size_t)(n))) +#define TMALLOC(t,n) ((t*) malloc((size_t)(n) * sizeof(t))) #define NEW(t) ((t*)allocate(sizeof(t))) #define NEW2(n,t) ((t*)allocate(((size_t)(n)*sizeof(t)))) #define REALLOC(p,n) (realloc((char*)(p),(size_t)(n))) +#define TREALLOC(t,p,n) ((t*)realloc((char*)(p), (size_t)(n) * sizeof(t))) #define DO_FREE(x) if (x) { FREE(x); x = 0; } @@ -241,6 +247,7 @@ extern char *line; extern int lineno; extern int outline; extern int exit_code; +extern int pure_parser; extern const char *const banner[]; extern const char *const xdecls[]; @@ -301,7 +308,6 @@ extern char *nullable; extern bucket *first_symbol; extern bucket *last_symbol; -extern int pure_parser; extern int nstates; extern core *first_state; extern shifts *first_shift; @@ -342,12 +348,22 @@ extern bucket *lookup(const char *); extern bucket *make_bucket(const char *); #ifndef GCC_NORETURN +#if defined(__dead2) +#define GCC_NORETURN __dead2 +#elif defined(__dead) +#define GCC_NORETURN __dead +#else #define GCC_NORETURN /* nothing */ #endif +#endif #ifndef GCC_UNUSED +#if defined(__unused) +#define GCC_UNUSED __unused +#else #define GCC_UNUSED /* nothing */ #endif +#endif /* closure.c */ extern void closure(Value_t * nucleus, int n); @@ -421,7 +437,7 @@ extern void output(void); extern void reader(void); /* skeleton.c */ -extern void write_section(FILE *fp, const char *const section[]); +extern void write_section(FILE * fp, const char *const section[]); /* verbose.c */ extern void verbose(void); |