stdex
Additional custom or not Standard C++ covered algorithms
Loading...
Searching...
No Matches
include
stdex
compat.hpp
1
/*
2
SPDX-License-Identifier: MIT
3
Copyright © 2022-2023 Amebis
4
*/
5
6
#pragma once
7
8
#include <stddef.h>
9
#ifdef _WIN32
10
#include <sal.h>
11
#endif
12
#include <type_traits>
13
14
#ifndef _In_
15
#define _In_
16
#endif
17
#ifndef _In_bytecount_
18
#define _In_bytecount_(p)
19
#endif
20
#ifndef _In_count_
21
#define _In_count_(p)
22
#endif
23
#ifndef _In_opt_
24
#define _In_opt_
25
#endif
26
#ifndef _In_opt_count_
27
#define _In_opt_count_(p)
28
#endif
29
#ifndef _In_opt_z_count_
30
#define _In_opt_z_count_(p)
31
#endif
32
#ifndef _In_z_
33
#define _In_z_
34
#endif
35
#ifndef _In_opt_z_
36
#define _In_opt_z_
37
#endif
38
#ifndef _In_z_count_
39
#define _In_z_count_(p)
40
#endif
41
#ifndef _In_reads_
42
#define _In_reads_(p)
43
#endif
44
#ifndef _In_reads_z_
45
#define _In_reads_z_(p)
46
#endif
47
#ifndef _In_reads_opt_
48
#define _In_reads_opt_(p)
49
#endif
50
#ifndef _In_reads_opt_z_
51
#define _In_reads_opt_z_(p)
52
#endif
53
#ifndef _In_reads_or_z_
54
#define _In_reads_or_z_(p)
55
#endif
56
#ifndef _In_reads_or_z_opt_
57
#define _In_reads_or_z_opt_(p)
58
#endif
59
#ifndef _In_reads_bytes_opt_
60
#define _In_reads_bytes_opt_(p)
61
#endif
62
#ifndef _Printf_format_string_params_
63
#define _Printf_format_string_params_(n)
64
#endif
65
66
#ifndef _Inout_
67
#define _Inout_
68
#endif
69
#ifndef _Inout_opt_
70
#define _Inout_opt_
71
#endif
72
#ifndef _Inout_cap_
73
#define _Inout_cap_(p)
74
#endif
75
#ifndef _Inout_count_
76
#define _Inout_count_(p)
77
#endif
78
79
#ifndef _Use_decl_annotations_
80
#define _Use_decl_annotations_
81
#endif
82
83
#ifndef _Out_
84
#define _Out_
85
#endif
86
#ifndef _Out_opt_
87
#define _Out_opt_
88
#endif
89
#ifndef _Out_z_cap_
90
#define _Out_z_cap_(p)
91
#endif
92
#ifndef _Out_writes_
93
#define _Out_writes_(p)
94
#endif
95
#ifndef _Out_writes_opt_
96
#define _Out_writes_opt_(p)
97
#endif
98
#ifndef _Out_writes_opt_z_
99
#define _Out_writes_opt_z_(p)
100
#endif
101
#ifndef _Out_writes_bytes_
102
#define _Out_writes_bytes_(p)
103
#endif
104
#ifndef _Out_writes_to_
105
#define _Out_writes_to_(p, q)
106
#endif
107
#ifndef _Out_writes_all_
108
#define _Out_writes_all_(p)
109
#endif
110
#ifndef _Out_writes_z_
111
#define _Out_writes_z_(p)
112
#endif
113
#ifndef _Out_writes_bytes_to_opt_
114
#define _Out_writes_bytes_to_opt_(p, q)
115
#endif
116
117
#ifndef _Success_
118
#define _Success_(p)
119
#endif
120
#ifndef _Ret_maybenull_
121
#define _Ret_maybenull_
122
#endif
123
#ifndef _Ret_maybenull_z_
124
#define _Ret_maybenull_z_
125
#endif
126
#ifndef _Ret_notnull_
127
#define _Ret_notnull_
128
#endif
129
#ifndef _Ret_z_
130
#define _Ret_z_
131
#endif
132
#ifndef _Must_inspect_result_
133
#define _Must_inspect_result_
134
#endif
135
#ifndef _Check_return_
136
#define _Check_return_
137
#endif
138
#ifndef _Post_maybez_
139
#define _Post_maybez_
140
#endif
141
#ifndef _Null_terminated_
142
#define _Null_terminated_
143
#endif
144
145
#ifndef _Analysis_assume_
146
#define _Analysis_assume_(p)
147
#endif
148
149
#ifndef _Likely_
150
#if _HAS_CXX20
151
#define _Likely_ [[likely]]
152
#else
153
#define _Likely_
154
#endif
155
#endif
156
157
#ifndef _Unlikely_
158
#if _HAS_CXX20
159
#define _Unlikely_ [[unlikely]]
160
#else
161
#define _Unlikely_
162
#endif
163
#endif
164
165
#if _HAS_CXX17
166
#define _Constexpr_ constexpr
167
#else
168
#define _Constexpr_
169
#endif
170
171
#ifdef _MSC_VER
172
#define _Deprecated_(message) __declspec(deprecated(message))
173
#else
174
#define _Deprecated_(message) [[deprecated(message)]]
175
#endif
176
177
#ifdef _WIN32
178
#define _Unreferenced_(x) UNREFERENCED_PARAMETER(x)
179
#else
180
#define _Unreferenced_(x)
181
#endif
182
183
#ifndef _WIN32
184
template
<
typename
T,
size_t
N>
185
size_t
_countof(T (&arr)[N])
186
{
187
return
std::extent<T[N]>::value;
188
}
189
#endif
190
191
#ifdef __APPLE__
192
#define off64_t off_t
193
#define lseek64 lseek
194
#define lockf64 lockf
195
#define ftruncate64 ftruncate
196
#endif
197
Generated on Tue Sep 19 2023 14:53:37 for stdex by
1.9.8