头文件
struct exception_s
{
jmp_buf env0;
int count0 = 0;
struct exception_s *next;
};
void sub_func(int idx);//longjmp与setjmp
jmp_buf env;
int count = 0;
struct exception_s *excep0 = NULL;
cpp
#if 0
#define TRY if((count = setjmp(env)) == 0)
#define Catch(Excep) else if(count == (Excep))
#define Finally //最后一个else的功能,如果else前没执行++idx不会执行到else,Finally是无论什么情况都会执行
#define Throw(Excep) longjmp(env,(Excep))//抛异常
#else
#define TRY if(excep0 == NULL){ \