]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/winapi/include/boost/detail/winapi/dbghelp.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / winapi / include / boost / detail / winapi / dbghelp.hpp
1 // dbghelp.hpp --------------------------------------------------------------//
2
3 // Copyright 2015 Klemens Morgenstern
4 // Copyright 2016 Jorge Lodos
5 // Copyright 2016 Andrey Semashev
6
7 // Distributed under the Boost Software License, Version 1.0.
8 // See http://www.boost.org/LICENSE_1_0.txt
9
10
11 #ifndef BOOST_DETAIL_WINAPI_DBGHELP_HPP
12 #define BOOST_DETAIL_WINAPI_DBGHELP_HPP
13
14 #include <boost/detail/winapi/basic_types.hpp>
15
16 #if defined( BOOST_USE_WINDOWS_H )
17 #if !defined( BOOST_WINAPI_IS_MINGW )
18 #include <dbghelp.h>
19 #else
20 // In MinGW there is no dbghelp.h but an older imagehlp.h header defines some of the symbols from it.
21 // Note that the user has to link with libimagehlp.a instead of libdbghelp.a for it to work.
22 #include <imagehlp.h>
23 #endif
24 #endif
25
26 #ifdef BOOST_HAS_PRAGMA_ONCE
27 #pragma once
28 #endif
29
30 // Some symbols declared below are not present in all versions of Windows SDK, MinGW and MinGW-w64.
31 // dbghelp.h/imagehlp.h define the API_VERSION_NUMBER macro which we use to detect its version.
32 // When the macro is not available we can only guess based on the compiler version or SDK type.
33 #if defined(API_VERSION_NUMBER)
34 #if API_VERSION_NUMBER >= 11
35 // UnDecorateSymbolNameW available since Windows SDK 6.0A and MinGW-w64 (as of 2016-02-14)
36 #define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
37 #endif
38 #elif defined(_MSC_VER) && _MSC_VER >= 1500
39 // Until MSVC 9.0 Windows SDK was bundled in Visual Studio and didn't have UnDecorateSymbolNameW.
40 // Supposedly, Windows SDK 6.0A was the first standalone one and it is used with MSVC 9.0.
41 #define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
42 #elif !defined(BOOST_WINAPI_IS_MINGW)
43 // MinGW does not provide UnDecorateSymbolNameW (as of 2016-02-14)
44 #define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
45 #endif
46
47 #if !defined( BOOST_USE_WINDOWS_H )
48 extern "C" {
49
50 struct API_VERSION;
51
52 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
53 UnDecorateSymbolName(
54 boost::detail::winapi::LPCSTR_ DecoratedName,
55 boost::detail::winapi::LPSTR_ UnDecoratedName,
56 boost::detail::winapi::DWORD_ UndecoratedLength,
57 boost::detail::winapi::DWORD_ Flags);
58
59 #if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
60 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
61 UnDecorateSymbolNameW(
62 boost::detail::winapi::LPCWSTR_ DecoratedName,
63 boost::detail::winapi::LPWSTR_ UnDecoratedName,
64 boost::detail::winapi::DWORD_ UndecoratedLength,
65 boost::detail::winapi::DWORD_ Flags);
66 #endif
67
68 BOOST_SYMBOL_IMPORT API_VERSION* WINAPI
69 ImagehlpApiVersion(BOOST_DETAIL_WINAPI_VOID);
70
71 } // extern "C"
72 #endif
73
74 namespace boost {
75 namespace detail {
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_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
122 using ::UnDecorateSymbolNameW;
123 #endif
124
125 typedef struct BOOST_DETAIL_WINAPI_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_DETAIL_WINAPI_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
171 #endif // BOOST_DETAIL_WINAPI_DBGHELP_HPP