diff options
author | John Millaway <john43@users.sourceforge.net> | 2002-04-13 04:16:05 +0000 |
---|---|---|
committer | John Millaway <john43@users.sourceforge.net> | 2002-04-13 04:16:05 +0000 |
commit | fd91640addbdf01ad03e1850c0aabe3270a63c0d (patch) | |
tree | 82ee479c0960d8c4ff0c337d862619e95baa2172 /flexdef.h | |
parent | 3b92cc89dc6e073a59ab202e67e12556b79ed962 (diff) |
defined FLEX_EXIT macro to call longjmp on errors.
Diffstat (limited to 'flexdef.h')
-rw-r--r-- | flexdef.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -37,6 +37,7 @@ #include <stdio.h> #include <ctype.h> #include <limits.h> +#include <setjmp.h> #include "config.h" @@ -1053,4 +1054,8 @@ extern struct Buf defs_buf; #define OUT_BEGIN_CODE() out_str("#ifndef %sIN_HEADER\n",prefix) #define OUT_END_CODE() out_str("#endif /* !%sIN_HEADER */\n",prefix); +/* For setjmp/longjmp (instead of calling exit(2)). Linkage in main.c */ +extern jmp_buf flex_main_jmp_buf; +#define FLEX_EXIT(status) longjmp(flex_main_jmp_buf,(status)+1) + #endif /* not defined FLEXDEF_H */ |