-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexcept.h
More file actions
36 lines (29 loc) · 1.42 KB
/
except.h
File metadata and controls
36 lines (29 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __EXCEPT_H__
#define __EXCEPT_H__
#define INCL_BASE
#include <os2.h>
#include <setjmp.h>
typedef struct _EXCEPTIONREGISTRATIONRECORD2
{
EXCEPTIONREGISTRATIONRECORD reg;
jmp_buf jmp;
} EXCEPTIONREGISTRATIONRECORD2, *PEXCEPTIONREGISTRATIONRECORD2;
extern ULONG APIENTRY ExceptionHandler(
PEXCEPTIONREPORTRECORD pRep,
PEXCEPTIONREGISTRATIONRECORD2 pReg,
PCONTEXTRECORD pCtx,
PVOID pDispCtx);
#define TRY(except) \
{ \
EXCEPTIONREGISTRATIONRECORD2 except={0}; \
except.reg.ExceptionHandler = (ERR)ExceptionHandler; \
DosSetExceptionHandler((PEXCEPTIONREGISTRATIONRECORD)&except); \
if (setjmp(except.jmp) == 0) {
#define CATCH() \
} else {
#define ENDTRY(except) \
} \
DosUnsetExceptionHandler((PEXCEPTIONREGISTRATIONRECORD)&except); \
}
#endif