Imported Upstream version 20120526
[platform/upstream/byacc.git] / defs.h
diff --git a/defs.h b/defs.h
index c774997..4d1a407 100644 (file)
--- a/defs.h
+++ b/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>
 #include <ctype.h>
 #include <stdio.h>
 
+#if defined(__cplusplus)       /* __cplusplus, etc. */
+#define class myClass
+#endif
+
 #define YYMAJOR 1
 #define YYMINOR 9
 
 #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; }
 
@@ -302,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;
@@ -343,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);
@@ -422,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);