- #include "stdio.h"
- #include "conio.h"
- #include "signal.h"
- #include "setjmp.h"
- #include "assert.h"
- #ifdef __cplusplus
- #include "iostream"
- #include "exception"
- extern "C"{
- #define dllexport __declspec(dllexport)
- jmp_buf Jmp_Buf;
- int E;
- #define Exception 0x00000
- #define e Exception
- #define try if(!(E=setjmp(Jmp_Buf)))
- #define last_error() E
- #define catch(val) else
- #define throw(val) longjmp(Jmp_Buf,val)
- #define check(expersion) assert(expersion)
- #define GetError() errno
- dllexport void sig_usr(int);
- dllexport char* getTime();
- }
- #else
- #define dllexport __declspec(dllexport)
- jmp_buf Jmp_Buf;
- int E;
- #define Exception 0x00000
- #define e Exception
- #define try if(!(E=setjmp(Jmp_Buf)))
- #define last_error() E
- #define catch(val) else
- #define throw(val) longjmp(Jmp_Buf,val)
- #define check(expersion) assert(expersion)
- #define GetError() errno
- dllexport void sig_usr(int);
- dllexport char* getTime();
- #endif
- //该片段来自于http://www.codesnippet.cn/detail/250220132219.html
来源: http://www.codesnippet.cn/detail/250220132219.html