except.c.svn-base

来自「纯C数据结构」· SVN-BASE 代码 · 共 27 行

SVN-BASE
27
字号
#include <stdlib.h>#include <stdio.h>#include "except.h"#define T Except_TExcept_Frame *Except_stack = NULL;void Except_raise(const T *e, const char *file, int line) {	Except_Frame *p = Except_stack;	if (p == NULL) {		fprintf(stderr, "Uncaught exception");		if (e->reason)			fprintf(stderr, " %s", e->reason);		else			fprintf(stderr, " at 0x%p", e);		if (file && line > 0)			fprintf(stderr, " raised at %s:%d\n", file, line);		fprintf(stderr, "aborting...\n");		fflush(stderr);		abort();	}	p->exception = e;	p->file = file;	p->line = line;	Except_stack = Except_stack->prev;	longjmp(p->env, 1);}static char rcsid[] = "$RCSfile: RCS/except.doc,v $ $Revision: 1.2 $";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?