summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1993-12-01 11:58:18 +0000
committerVern Paxson <vern@ee.lbl.gov>1993-12-01 11:58:18 +0000
commit555e2640d7eefc00f02d372ccf60d66534620527 (patch)
treeeba1bc33ec6a5043ecd3301300df616a91080d4d
parente11471bb404a63a99c275ea7252a8a5a7f8adc44 (diff)
yy_flex_xmalloc() moved to misc.c
-rw-r--r--flexdef.h3
-rw-r--r--misc.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/flexdef.h b/flexdef.h
index eb7af1a..8164b5f 100644
--- a/flexdef.h
+++ b/flexdef.h
@@ -767,6 +767,9 @@ extern void skelout PROTO((void));
/* Output a yy_trans_info structure. */
extern void transition_struct_out PROTO((int, int));
+/* Only needed when using certain broken versions of bison to build parse.c. */
+extern void *yy_flex_xmalloc PROTO(( int ));
+
/* Set a region of memory to 0. */
extern void zero_out PROTO((char *, int));
diff --git a/misc.c b/misc.c
index 9db1afd..8e0efa7 100644
--- a/misc.c
+++ b/misc.c
@@ -740,6 +740,21 @@ int element_v, element_n;
}
+/* The following is only needed when building flex's parser using certain
+ * broken versions of bison.
+ */
+void *yy_flex_xmalloc( size )
+int size;
+ {
+ void *result = yy_flex_alloc( size );
+
+ if ( ! result )
+ flexfatal( "memory allocation failed in yy_flex_xmalloc()" );
+
+ return result;
+ }
+
+
/* zero_out - set a region of memory to 0
*
* Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.