]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/winapi/dbghelp.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / winapi / dbghelp.hpp
1 /*
2 * Copyright 2015 Klemens Morgenstern
3 * Copyright 2016 Jorge Lodos
4 * Copyright 2016 Andrey Semashev
5 *
6 * Distributed under the Boost Software License, Version 1.0.
7 * See http://www.boost.org/LICENSE_1_0.txt
8 */
9
10 #ifndef BOOST_WINAPI_DBGHELP_HPP_INCLUDED_
11 #define BOOST_WINAPI_DBGHELP_HPP_INCLUDED_
12
13 #include <boost/winapi/basic_types.hpp>
14
15 #if defined( BOOST_USE_WINDOWS_H )
16 #if !defined( BOOST_WINAPI_IS_MINGW )
17 #include <dbghelp.h>
18 #else
19 // In MinGW there is no dbghelp.h but an older imagehlp.h header defines some of the symbols from it.
20 // Note that the user has to link with libimagehlp.a instead of libdbghelp.a for it to work.
21 #include <imagehlp.h>
22 #endif
23 #endif
24
25 #ifdef BOOST_HAS_PRAGMA_ONCE
26 #pragma once
27 #endif
28
29 #if BOOST_WINAPI_PARTITION_DESKTOP
30
31 // Some symbols declared below are not present in all versions of Windows SDK, MinGW and MinGW-w64.
32 // dbghelp.h/imagehlp.h define the API_VERSION_NUMBER macro which we use to detect its version.
33 // When the macro is not available we can only guess based on the compiler version or SDK type.
34 #if defined(API_VERSION_NUMBER)
35 #if API_VERSION_NUMBER >= 11
36 // UnDecorateSymbolNameW available since Windows SDK 6.0A and MinGW-w64 (as of 2016-02-14)
37 #define BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW
38 #endif
39 #elif defined(_MSC_VER) && _MSC_VER >= 1500
40 // Until MSVC 9.0 Windows SDK was bundled in Visual Studio and didn't have UnDecorateSymbolNameW.
41 // Supposedly, Windows SDK 6.0A was the first standalone one and it is used with MSVC 9.0.
42 #define BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW
43 #elif !defined(BOOST_WINAPI_IS_MINGW)
44 // MinGW does not provide UnDecorateSymbolNameW (as of 2016-02-14)
45 #define BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW
46 #endif
47
48 #if !defined( BOOST_USE_WINDOWS_H )
49 extern "C" {
50
51 struct API_VERSION;
52
53 BOOST_SYMBOL_IMPORT boost::winapi::DWORD_ WINAPI
54 UnDecorateSymbolName(
55 boost::winapi::LPCSTR_ DecoratedName,
56 boost::winapi::LPSTR_ UnDecoratedName,
57 boost::winapi::DWORD_ UndecoratedLength,
58 boost::winapi::DWORD_ Flags);
59
60 #if defined( BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW )
61 BOOST_SYMBOL_IMPORT boost::winapi::DWORD_ WINAPI
62 UnDecorateSymbolNameW(
63 boost::winapi::LPCWSTR_ DecoratedName,
64 boost::winapi::LPWSTR_ UnDecoratedName,
65 boost::winapi::DWORD_ UndecoratedLength,
66 boost::winapi::DWORD_ Flags);
67 #endif
68
69 BOOST_SYMBOL_IMPORT API_VERSION* WINAPI
70 ImagehlpApiVersion(BOOST_WINAPI_DETAIL_VOID);
71
72 } // extern "C"
73 #endif
74
75 namespace boost {
76 namespace winapi {
77
78 #if defined( BOOST_USE_WINDOWS_H )
79
80 const DWORD_ UNDNAME_COMPLETE_ = UNDNAME_COMPLETE;
81 const DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = UNDNAME_NO_LEADING_UNDERSCORES;
82 const DWORD_ UNDNAME_NO_MS_KEYWORDS_ = UNDNAME_NO_MS_KEYWORDS;
83 const DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = UNDNAME_NO_FUNCTION_RETURNS;
84 const DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = UNDNAME_NO_ALLOCATION_MODEL;
85 const DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = UNDNAME_NO_ALLOCATION_LANGUAGE;
86 const DWORD_ UNDNAME_NO_MS_THISTYPE_ = UNDNAME_NO_MS_THISTYPE;
87 const DWORD_ UNDNAME_NO_CV_THISTYPE_ = UNDNAME_NO_CV_THISTYPE;
88 const DWORD_ UNDNAME_NO_THISTYPE_ = UNDNAME_NO_THISTYPE;
89 const DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = UNDNAME_NO_ACCESS_SPECIFIERS;
90 const DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = UNDNAME_NO_THROW_SIGNATURES;
91 const DWORD_ UNDNAME_NO_MEMBER_TYPE_ = UNDNAME_NO_MEMBER_TYPE;
92 const DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = UNDNAME_NO_RETURN_UDT_MODEL;
93 const DWORD_ UNDNAME_32_BIT_DECODE_ = UNDNAME_32_BIT_DECODE;
94 const DWORD_ UNDNAME_NAME_ONLY_ = UNDNAME_NAME_ONLY;
95 const DWORD_ UNDNAME_NO_ARGUMENTS_ = UNDNAME_NO_ARGUMENTS;
96 const DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = UNDNAME_NO_SPECIAL_SYMS;
97
98 #else // defined( BOOST_USE_WINDOWS_H )
99
100 const DWORD_ UNDNAME_COMPLETE_ = 0x00000000;
101 const DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = 0x00000001;
102 const DWORD_ UNDNAME_NO_MS_KEYWORDS_ = 0x00000002;
103 const DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = 0x00000004;
104 const DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = 0x00000008;
105 const DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = 0x00000010;
106 const DWORD_ UNDNAME_NO_MS_THISTYPE_ = 0x00000020;
107 const DWORD_ UNDNAME_NO_CV_THISTYPE_ = 0x00000040;
108 const DWORD_ UNDNAME_NO_THISTYPE_ = 0x00000060;
109 const DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = 0x00000080;
110 const DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = 0x00000100;
111 const DWORD_ UNDNAME_NO_MEMBER_TYPE_ = 0x00000200;
112 const DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = 0x00000400;
113 const DWORD_ UNDNAME_32_BIT_DECODE_ = 0x00000800;
114 const DWORD_ UNDNAME_NAME_ONLY_ = 0x00001000;
115 const DWORD_ UNDNAME_NO_ARGUMENTS_ = 0x00002000;
116 const DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = 0x00004000;
117
118 #endif // defined( BOOST_USE_WINDOWS_H )
119
120 using ::UnDecorateSymbolName;
121 #if defined( BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW )
122 using ::UnDecorateSymbolNameW;
123 #endif
124
125 typedef struct BOOST_MAY_ALIAS API_VERSION {
126 USHORT_ MajorVersion;
127 USHORT_ MinorVersion;
128 USHORT_ Revision;
129 USHORT_ Reserved;
130 } API_VERSION_, *LPAPI_VERSION_;
131
132 BOOST_FORCEINLINE LPAPI_VERSION_ ImagehlpApiVersion()
133 {
134 return reinterpret_cast<LPAPI_VERSION_>(::ImagehlpApiVersion());
135 }
136
137 BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
138 LPCSTR_ DecoratedName,
139 LPSTR_ UnDecoratedName,
140 DWORD_ UndecoratedLength,
141 DWORD_ Flags)
142 {
143 return ::UnDecorateSymbolName(
144 DecoratedName,
145 UnDecoratedName,
146 UndecoratedLength,
147 Flags);
148 }
149
150 #if defined( BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW )
151
152 BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
153 LPCWSTR_ DecoratedName,
154 LPWSTR_ UnDecoratedName,
155 DWORD_ UndecoratedLength,
156 DWORD_ Flags)
157 {
158 return ::UnDecorateSymbolNameW(
159 DecoratedName,
160 UnDecoratedName,
161 UndecoratedLength,
162 Flags);
163 }
164
165 #endif
166
167 }
168 }
169
170 #endif // BOOST_WINAPI_PARTITION_DESKTOP
171 #endif // BOOST_WINAPI_DBGHELP_HPP_INCLUDED_