Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/include/atldef.h
4386 views
1
/*
2
* Copyright 2019 Alistair Leslie-Hughes
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17
*/
18
#ifndef __ATLDEF_H__
19
#define __ATLDEF_H__
20
21
22
#include "sal.h"
23
24
#ifndef _ATL_USE_WINAPI_FAMILY_DESKTOP_APP
25
#define _ATL_USE_WINAPI_FAMILY_DESKTOP_APP
26
#endif
27
28
#ifndef ATLPREFAST_SUPPRESS
29
#define ATLPREFAST_SUPPRESS(x)
30
#endif
31
32
#ifndef ATLPREFAST_UNSUPPRESS
33
#define ATLPREFAST_UNSUPPRESS(x)
34
#endif
35
36
#ifndef ATLASSERT
37
#define ATLASSERT(x)
38
#endif
39
40
#ifndef ATLASSUME
41
#define ATLASSUME(x)
42
#endif
43
44
#ifndef ATLENSURE
45
#define ATLENSURE(expr)
46
#endif
47
48
#define ATL_NOINLINE
49
50
#define _ATL_DECLSPEC_ALLOCATOR
51
52
#ifndef _FormatMessage_format_string_
53
#define _FormatMessage_format_string_
54
#endif
55
56
#define ATLAPI HRESULT __stdcall
57
#define ATLAPI_(x) x __stdcall
58
#define ATLINLINE inline
59
60
/* Belongs elsewhere */
61
#define ATLTRACE(...)
62
63
#define ATL_MAKEINTRESOURCEA(i) ((LPSTR)((ULONG_PTR)((WORD)(i))))
64
#define ATL_MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i))))
65
#ifndef RC_INVOKED
66
# ifdef WINE_NO_UNICODE_MACROS /* force using a cast */
67
# define ATL_MAKEINTRESOURCE(i) ((ULONG_PTR)((WORD)(i)))
68
# else
69
# define ATL_MAKEINTRESOURCE WINELIB_NAME_AW(ATL_MAKEINTRESOURCE)
70
# endif
71
#endif
72
73
#define ATL_IS_INTRESOURCE(x) (((ULONG_PTR)(x) >> 16) == 0)
74
75
#define ATL_RT_CURSOR ATL_MAKEINTRESOURCEA(1)
76
#define ATL_RT_BITMAP ATL_MAKEINTRESOURCEA(2)
77
#define ATL_RT_ICON ATL_MAKEINTRESOURCEA(3)
78
#define ATL_RT_MENU ATL_MAKEINTRESOURCEA(4)
79
#define ATL_RT_DIALOG ATL_MAKEINTRESOURCEA(5)
80
#define ATL_RT_STRING ATL_MAKEINTRESOURCEA(6)
81
#define ATL_RT_FONTDIR ATL_MAKEINTRESOURCEA(7)
82
#define ATL_RT_FONT ATL_MAKEINTRESOURCEA(8)
83
#define ATL_RT_ACCELERATOR ATL_MAKEINTRESOURCEA(9)
84
#define ATL_RT_RCDATA ATL_MAKEINTRESOURCEA(10)
85
#define ATL_RT_MESSAGETABLE ATL_MAKEINTRESOURCEA(11)
86
87
#define ATL_DIFFERENCE 11
88
#define ATL_RT_GROUP_CURSOR ATL_MAKEINTRESOURCEW((ULONG_PTR)ATL_RT_CURSOR + ATL_DIFFERENCE)
89
#define ATL_RT_GROUP_ICON ATL_MAKEINTRESOURCEW((ULONG_PTR)ATL_RT_ICON + ATL_DIFFERENCE)
90
#define ATL_RT_VERSION ATL_MAKEINTRESOURCEA(16)
91
#define ATL_RT_DLGINCLUDE ATL_MAKEINTRESOURCEA(17)
92
#define ATL_RT_PLUGPLAY ATL_MAKEINTRESOURCEA(19)
93
#define ATL_RT_VXD ATL_MAKEINTRESOURCEA(20)
94
#define ATL_RT_ANICURSOR ATL_MAKEINTRESOURCEA(21)
95
#define ATL_RT_ANIICON ATL_MAKEINTRESOURCEA(22)
96
#define ATL_RT_HTML ATL_MAKEINTRESOURCEA(23)
97
98
#ifndef AtlThrow
99
#ifndef _ATL_CUSTOM_THROW
100
#define AtlThrow ATL::AtlThrowImpl
101
#endif
102
#endif
103
104
#ifdef __cplusplus
105
106
template < typename T >
107
inline T* SAL_Assume_bytecap_for_opt_(T* buf, size_t dwLen)
108
{
109
return buf;
110
}
111
112
namespace ATL
113
{
114
template <typename T>
115
inline T* SAL_Assume_notnull_for_opt_z_(T* buf)
116
{
117
ATLASSUME(buf!=0);
118
return buf;
119
}
120
121
#ifndef _ATL_CUSTOM_THROW
122
ATL_NOINLINE DECLSPEC_NORETURN inline void WINAPI AtlThrowImpl(_In_ HRESULT hr);
123
#endif
124
ATL_NOINLINE DECLSPEC_NORETURN inline void WINAPI AtlThrowLastWin32();
125
}
126
127
#endif
128
129
#endif /* __ATLDEF_H__ */
130
131