|
|
|
| 1 |
|
/*** |
| 2 |
|
*eh.h - User include file for exception handling. |
| 3 |
|
* |
| 4 |
|
* Copyright (c) Microsoft Corporation. All rights reserved. |
| 5 |
|
* |
| 6 |
|
*Purpose: |
| 7 |
|
* User include file for exception handling. |
| 8 |
|
* |
| 9 |
|
* [Public] |
| 10 |
|
* |
| 11 |
|
****/ |
| 12 |
|
|
| 13 |
|
#if _MSC_VER > 1000 |
| 14 |
|
#pragma once |
| 15 |
|
#endif |
| 16 |
|
|
| 17 |
|
#include <crtdefs.h> |
| 18 |
|
|
| 19 |
|
#ifndef _INC_EH |
| 20 |
|
#define _INC_EH |
| 21 |
|
#ifndef RC_INVOKED |
| 22 |
|
#ifdef _MSC_VER |
| 23 |
|
/* Currently, all MS C compilers for Win32 platforms default to 8 byte |
| 24 |
|
* alignment. |
| 25 |
|
*/ |
| 26 |
|
#pragma pack(push,_CRT_PACKING) |
| 27 |
|
#endif /* _MSC_VER */ |
| 28 |
|
|
| 29 |
|
#ifndef __cplusplus |
| 30 |
|
#error "eh.h is only for C++!" |
| 31 |
|
#endif |
| 32 |
|
|
| 33 |
|
/* terminate_handler is the standard name; terminate_function is supported for historical reasons */ |
| 34 |
|
#ifndef _M_CEE_PURE |
| 35 |
|
typedef void (__cdecl *terminate_function)(); |
| 36 |
|
typedef void (__cdecl *terminate_handler)(); |
| 43 |
|
typedef void (__clrcall *unexpected_handler)(); |
| 44 |
|
#endif |
| 45 |
|
|
| 46 |
|
#ifdef _M_CEE |
| 47 |
|
typedef void (__clrcall *__terminate_function_m)(); |
| 48 |
|
typedef void (__clrcall *__terminate_handler_m)(); |
| 49 |
|
typedef void (__clrcall *__unexpected_function_m)(); |
| 50 |
|
typedef void (__clrcall *__unexpected_handler_m)(); |
| 51 |
|
#endif |
| 52 |
|
|
| 53 |
|
struct _EXCEPTION_POINTERS; |
| 54 |
|
#ifndef _M_CEE_PURE |
| 55 |
|
typedef void (__cdecl *_se_translator_function)(unsigned int, struct _EXCEPTION_POINTERS*); |
| 56 |
|
#endif |
| 57 |
|
|
| 58 |
|
_CRTIMP __declspec(noreturn) void __cdecl terminate(void); |
| 59 |
|
_CRTIMP void __cdecl unexpected(void); |
| 60 |
|
|
| 61 |
|
_CRTIMP int __cdecl _is_exception_typeof(_In_ const type_info &_Type, _In_ struct _EXCEPTION_POINTERS * _ExceptionPtr); |
| 62 |
|
|
| 63 |
|
#ifndef _M_CEE_PURE |
| 64 |
|
/* only __clrcall versions provided by the MRT exist in pure */ |
| 65 |
|
_CRTIMP terminate_function __cdecl set_terminate(_In_opt_ terminate_function _NewPtFunc); |
| 66 |
|
extern "C" _CRTIMP terminate_function __cdecl _get_terminate(void); |
| 67 |
|
_CRTIMP unexpected_function __cdecl set_unexpected(_In_opt_ unexpected_function _NewPtFunc); |
| 68 |
|
extern "C" _CRTIMP unexpected_function __cdecl _get_unexpected(void); |
| 69 |
|
#endif |
| 70 |
|
|
| 71 |
|
#ifndef _M_CEE_PURE |
| 72 |
|
/* set_se_translator cannot be a managed implementation, and so cannot be called from _M_CEE_PURE code */ |
| 73 |
|
_CRTIMP _se_translator_function __cdecl _set_se_translator(_In_opt_ _se_translator_function _NewPtFunc); |
| 74 |
|
#endif |
| 75 |
|
_CRTIMP bool __cdecl __uncaught_exception(); |
| 76 |
|
|
| 77 |
|
/* |
| 78 |
|
* These overload helps in resolving NULL |
| 79 |
|
*/ |
| 80 |
|
#ifdef _M_CEE_MIXED |
| 81 |
|
_CRTIMP terminate_function __cdecl set_terminate(_In_ int _Zero); |
| 82 |
|
_CRTIMP unexpected_function __cdecl set_unexpected(_In_ int _Zero); |
| 83 |
|
#endif |
| 84 |
|
|
| 85 |
|
#ifdef _M_CEE |
| 86 |
|
_MRTIMP __terminate_function_m __cdecl set_terminate(_In_opt_ __terminate_function_m _NewPtFunc); |
| 87 |
|
_MRTIMP __unexpected_function_m __cdecl set_unexpected(_In_opt_ __unexpected_function_m _NewPtFunc); |
| 88 |
|
#endif |
| 89 |
|
|
| 90 |
|
#ifdef _MSC_VER |
| 91 |
|
#pragma pack(pop) |
| 92 |
|
#endif /* _MSC_VER */ |
| 93 |
|
#endif /* RC_INVOKED */ |
| 94 |
|
#endif /* _INC_EH */ |
| 95 |
|
|
|
|
|