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_z_
73
#define _Inout_z_
74
#endif
75
#ifndef _Inout_cap_
76
#define _Inout_cap_(p)
77
#endif
78
#ifndef _Inout_count_
79
#define _Inout_count_(p)
80
#endif
81
#ifndef _Inout_updates_z_
82
#define _Inout_updates_z_(p)
83
#endif
84
85
#ifndef _Use_decl_annotations_
86
#define _Use_decl_annotations_
87
#endif
88
89
#ifndef _Out_
90
#define _Out_
91
#endif
92
#ifndef _Out_opt_
93
#define _Out_opt_
94
#endif
95
#ifndef _Out_z_cap_
96
#define _Out_z_cap_(p)
97
#endif
98
#ifndef _Out_writes_
99
#define _Out_writes_(p)
100
#endif
101
#ifndef _Out_writes_opt_
102
#define _Out_writes_opt_(p)
103
#endif
104
#ifndef _Out_writes_opt_z_
105
#define _Out_writes_opt_z_(p)
106
#endif
107
#ifndef _Out_writes_bytes_
108
#define _Out_writes_bytes_(p)
109
#endif
110
#ifndef _Out_writes_to_
111
#define _Out_writes_to_(p, q)
112
#endif
113
#ifndef _Out_writes_all_
114
#define _Out_writes_all_(p)
115
#endif
116
#ifndef _Out_writes_z_
117
#define _Out_writes_z_(p)
118
#endif
119
#ifndef _Out_writes_bytes_to_opt_
120
#define _Out_writes_bytes_to_opt_(p, q)
121
#endif
122
123
#ifndef _Success_
124
#define _Success_(p)
125
#endif
126
#ifndef _Ret_maybenull_
127
#define _Ret_maybenull_
128
#endif
129
#ifndef _Ret_maybenull_z_
130
#define _Ret_maybenull_z_
131
#endif
132
#ifndef _Ret_notnull_
133
#define _Ret_notnull_
134
#endif
135
#ifndef _Ret_z_
136
#define _Ret_z_
137
#endif
138
#ifndef _Must_inspect_result_
139
#define _Must_inspect_result_
140
#endif
141
#ifndef _Check_return_
142
#define _Check_return_
143
#endif
144
#ifndef _Post_maybez_
145
#define _Post_maybez_
146
#endif
147
#ifndef _Null_terminated_
148
#define _Null_terminated_
149
#endif
150
151
#ifndef _Analysis_assume_
152
#define _Analysis_assume_(p)
153
#endif
154
155
#ifndef _Likely_
156
#if _HAS_CXX20
157
#define _Likely_ [[likely]]
158
#else
159
#define _Likely_
160
#endif
161
#endif
162
163
#ifndef _Unlikely_
164
#if _HAS_CXX20
165
#define _Unlikely_ [[unlikely]]
166
#else
167
#define _Unlikely_
168
#endif
169
#endif
170
171
#if _HAS_CXX17
172
#define _Constexpr_ constexpr
173
#else
174
#define _Constexpr_
175
#endif
176
177
#ifdef _MSC_VER
178
#define _Deprecated_(message) __declspec(deprecated(message))
179
#else
180
#define _Deprecated_(message) [[deprecated(message)]]
181
#endif
182
183
#ifdef _WIN32
184
#define _Unreferenced_(x) UNREFERENCED_PARAMETER(x)
185
#else
186
#define _Unreferenced_(x)
187
#endif
188
189
#ifndef _WIN32
190
template
<
typename
T,
size_t
N>
191
size_t
_countof(T (&arr)[N])
192
{
193
return
std::extent<T[N]>::value;
194
}
195
#endif
196
197
#ifdef __APPLE__
198
#define off64_t off_t
199
#define lseek64 lseek
200
#define lockf64 lockf
201
#define ftruncate64 ftruncate
202
#endif
203
Generated on Mon Sep 25 2023 12:57:45 for stdex by
1.9.8