diff options
-rw-r--r-- | tools/lemon/lemon.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c index e5d1a4f18e..68f7071adc 100644 --- a/tools/lemon/lemon.c +++ b/tools/lemon/lemon.c @@ -422,8 +422,8 @@ struct lemon { }; #define MemoryCheck(X) if((X)==0){ \ - fprintf(stderr,"Out of memory. Aborting...\n"); \ - exit(1); \ + extern void memory_error(void); \ + memory_error(); \ } /**************** From the file "table.h" *********************************/ @@ -1513,6 +1513,14 @@ make_basename(char* fullname) return new_string; } +/* Report an out-of-memory condition and abort. This function +** is used mostly by the "MemoryCheck" macro in struct.h +*/ +void memory_error(void){ + fprintf(stderr,"Out of memory. Aborting...\n"); + exit(1); +} + static int nDefine = 0; /* Number of -D options on the command line */ static char **azDefine = 0; /* Name of the -D macros */ |