]> granicus.if.org Git - flex/commitdiff
defined FLEX_EXIT macro to call longjmp on errors.
authorJohn Millaway <john43@users.sourceforge.net>
Sat, 13 Apr 2002 04:16:05 +0000 (04:16 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Sat, 13 Apr 2002 04:16:05 +0000 (04:16 +0000)
flexdef.h

index 3ecdc5364bc629f1cf83674506c2d034bb47131a..68457ac8671431e1e7ce9c967674293350054441 100644 (file)
--- 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 */