summaryrefslogtreecommitdiff
path: root/flexdef.h
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-04-13 04:16:05 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-04-13 04:16:05 +0000
commitfd91640addbdf01ad03e1850c0aabe3270a63c0d (patch)
tree82ee479c0960d8c4ff0c337d862619e95baa2172 /flexdef.h
parent3b92cc89dc6e073a59ab202e67e12556b79ed962 (diff)
defined FLEX_EXIT macro to call longjmp on errors.
Diffstat (limited to 'flexdef.h')
-rw-r--r--flexdef.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/flexdef.h b/flexdef.h
index 3ecdc53..68457ac 100644
--- a/flexdef.h
+++ b/flexdef.h
@@ -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 */