STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
eh.h
Go to the documentation of this file.
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 #pragma once
14 
15 #include <crtdefs.h>
16 
17 #ifndef _INC_EH
18 #define _INC_EH
19 #ifndef RC_INVOKED
20 
21 /* Currently, all MS C compilers for Win32 platforms default to 8 byte
22  * alignment.
23  */
24 #pragma pack(push,_CRT_PACKING)
25 
26 #ifndef __cplusplus
27 #error "eh.h is only for C++!"
28 #endif /* __cplusplus */
29 
30 /* terminate_handler is the standard name; terminate_function is supported for historical reasons */
31 #ifndef _M_CEE_PURE
32 typedef void (__cdecl *terminate_function)();
33 typedef void (__cdecl *terminate_handler)();
34 typedef void (__cdecl *unexpected_function)();
35 typedef void (__cdecl *unexpected_handler)();
36 #else /* _M_CEE_PURE */
37 typedef void (__clrcall *terminate_function)();
38 typedef void (__clrcall *terminate_handler)();
39 typedef void (__clrcall *unexpected_function)();
40 typedef void (__clrcall *unexpected_handler)();
41 #endif /* _M_CEE_PURE */
42 
43 #ifdef _M_CEE
44 typedef void (__clrcall *__terminate_function_m)();
45 typedef void (__clrcall *__terminate_handler_m)();
46 typedef void (__clrcall *__unexpected_function_m)();
47 typedef void (__clrcall *__unexpected_handler_m)();
48 #endif /* _M_CEE */
49 
50 struct _EXCEPTION_POINTERS;
51 #ifndef _M_CEE_PURE
52 typedef void (__cdecl *_se_translator_function)(unsigned int, struct _EXCEPTION_POINTERS*);
53 #endif /* _M_CEE_PURE */
54 
55 _CRTIMP __declspec(noreturn) void __cdecl terminate(void);
56 _CRTIMP __declspec(noreturn) void __cdecl unexpected(void);
57 
58 _CRTIMP int __cdecl _is_exception_typeof(_In_ const type_info &_Type, _In_ struct _EXCEPTION_POINTERS * _ExceptionPtr);
59 
60 #ifndef _M_CEE_PURE
61 /* only __clrcall versions provided by the MRT exist in pure */
63 extern "C" _CRTIMP terminate_function __cdecl _get_terminate(void);
65 extern "C" _CRTIMP unexpected_function __cdecl _get_unexpected(void);
66 #endif /* _M_CEE_PURE */
67 
68 #ifndef _M_CEE_PURE
69 /* set_se_translator cannot be a managed implementation, and so cannot be called from _M_CEE_PURE code */
70 _CRTIMP _se_translator_function __cdecl _set_se_translator(_In_opt_ _se_translator_function _NewPtFunc);
71 #endif /* _M_CEE_PURE */
72 _CRTIMP bool __cdecl __uncaught_exception();
73 
74 /*
75  * These overload helps in resolving NULL
76  */
77 #ifdef _M_CEE
78 _CRTIMP terminate_function __cdecl set_terminate(_In_ int _Zero);
80 #endif /* _M_CEE */
81 
82 #pragma pack(pop)
83 #endif /* RC_INVOKED */
84 #endif /* _INC_EH */
void(__cdecl * terminate_handler)()
Definition: eh.h:33
void __CRTDECL unexpected()
Definition: exception:307
_CRTIMP unexpected_function __cdecl _get_unexpected(void)
_CRTIMP terminate_function __cdecl _get_terminate(void)
#define _CRTIMP
Definition: crtdefs.h:23
void(__cdecl * unexpected_function)()
Definition: eh.h:34
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
typedef void(__cdecl *_se_translator_function)(unsigned int
void __CRTDECL terminate()
Definition: exception:303
_CRTIMP int __cdecl _is_exception_typeof(_In_ const type_info &_Type, _In_ struct _EXCEPTION_POINTERS *_ExceptionPtr)
void(__cdecl * unexpected_handler)()
Definition: eh.h:35
_CRTIMP terminate_function __cdecl set_terminate(_In_opt_ terminate_function _NewPtFunc)
#define _In_
Definition: sal.h:314
struct _EXCEPTION_POINTERS *_CRTIMP __declspec(noreturn) void __cdecl terminate(void)
Definition: eh.h:55
#define _In_opt_
Definition: sal.h:315
_CRTIMP unexpected_function __cdecl set_unexpected(_In_opt_ unexpected_function _NewPtFunc)
_CRTIMP _se_translator_function __cdecl _set_se_translator(_In_opt_ _se_translator_function _NewPtFunc)
_In_ wctype_t _Type
Definition: ctype.h:205
_CRTIMP bool __cdecl __uncaught_exception()
void(__cdecl * terminate_function)()
Definition: eh.h:32
Definition: typeinfo:44