diff options
Diffstat (limited to '')
-rw-r--r-- | public/sdk/rpc16/mac/inc/rpcmac.h | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/public/sdk/rpc16/mac/inc/rpcmac.h b/public/sdk/rpc16/mac/inc/rpcmac.h new file mode 100644 index 000000000..b5d59d39b --- /dev/null +++ b/public/sdk/rpc16/mac/inc/rpcmac.h @@ -0,0 +1,121 @@ +/*++ + +Copyright (c) 1994 Microsoft Corporation + +Module Name: + + RpcMac.h + +Abstract: + + Macintosh RPC specific exception handler macros. + +Author: + + Mario Goertzel [mariogo] 02-Nov-1994 + +--*/ + +#ifndef __RPCMAC_H__ +#define __RPCMAC_H__ + +typedef struct _ExceptionBuff { +#if _MSC_VER >= 1000 + jmp_buf registers; +#else + int registers[RPCXCWORD]; +#endif + struct _ExceptionBuff __RPC_FAR *pExceptNext; +} ExceptionBuff, __RPC_FAR *pExceptionBuff; + +void RPC_ENTRY RpcSetException(pExceptionBuff); +void RPC_ENTRY RpcLeaveException(void); + +#ifdef _MPPC_ +int __cdecl RpcSetJmp(jmp_buf); +#else +#define BLD_RT +#endif + +#ifdef BLD_RT +#define RpcTryExcept \ + { \ + int _exception_code; \ + ExceptionBuff exception; \ + RpcSetException(&exception); \ + \ + _exception_code = (setjmp(exception.registers)); \ + \ + if (!_exception_code) \ + { +#else +#define RpcTryExcept \ + { \ + int _exception_code; \ + ExceptionBuff exception; \ + RpcSetException(&exception); \ + \ + _exception_code = (RpcSetJmp(exception.registers)); \ + \ + if (!_exception_code) \ + { +#endif + +// trystmts + +#define RpcExcept(expr) \ + RpcLeaveException(); \ + } \ + else \ + { \ + if (!(expr)) \ + RpcRaiseException(_exception_code); + +// exceptstmts + +#define RpcEndExcept \ + } \ + } + +#ifdef BLD_RT +#define RpcTryFinally \ + { \ + int _abnormal_termination; \ + ExceptionBuff exception; \ + RpcSetException(&exception); \ + \ + _abnormal_termination = (setjmp(exception.registers)); \ + \ + if (!_abnormal_termination) \ + { +#else +#define RpcTryFinally \ + { \ + int _abnormal_termination; \ + ExceptionBuff exception; \ + RpcSetException(&exception); \ + \ + _abnormal_termination = (RpcSetJmp(exception.registers)); \ + \ + if (!_abnormal_termination) \ + { +#endif + +// trystmts + +#define RpcFinally \ + RpcLeaveException(); \ + } + +// finallystmts + +#define RpcEndFinally \ + if (_abnormal_termination) \ + RpcRaiseException(_abnormal_termination); \ + } + +#define RpcExceptionCode() _exception_code +#define RpcAbnormalTermination() _abnormal_termination + +#endif // __RPCMAC_H__ +
\ No newline at end of file |