ossp-pkg/ex/ex.c 1.3 -> 1.4
--- ex.c 2002/01/26 22:35:02 1.3
+++ ex.c 2002/01/29 11:05:21 1.4
@@ -28,7 +28,28 @@
** ex.c: exception handling (compiler part)
*/
+#include <stdio.h>
+#include <stdlib.h>
+
#include "ex.h"
-ex_ctx_t __ex_ctx_global;
+static ex_ctx_t *ex_ctx_default(void)
+{
+ static ex_ctx_t ctx = EX_CTX_INITIALIZER;
+
+ return &ctx;
+}
+
+static void ex_terminate_default(ex_t *e)
+{
+ fprintf(stderr,
+ "**EX: UNCAUGHT EXCEPTION: "
+ "class=0x%lx object=0x%lx value=0x%lx [%s:%d@%s]\n",
+ (long)((e)->ex_class), (long)((e)->ex_object), (long)((e)->ex_value),
+ (e)->ex_file, (e)->ex_line, (e)->ex_func);
+ abort();
+}
+
+ex_ctx_cb_t __ex_ctx = &ex_ctx_default;
+ex_term_cb_t __ex_terminate = &ex_terminate_default;
|
|