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_or_z_
45
#define _In_reads_or_z_(p)
46
#endif
47
#ifndef _In_reads_or_z_opt_
48
#define _In_reads_or_z_opt_(p)
49
#endif
50
#ifndef _In_reads_bytes_opt_
51
#define _In_reads_bytes_opt_(p)
52
#endif
53
#ifndef _Printf_format_string_params_
54
#define _Printf_format_string_params_(n)
55
#endif
56
57
#ifndef _Inout_
58
#define _Inout_
59
#endif
60
#ifndef _Inout_opt_
61
#define _Inout_opt_
62
#endif
63
#ifndef _Inout_cap_
64
#define _Inout_cap_(p)
65
#endif
66
67
#ifndef _Use_decl_annotations_
68
#define _Use_decl_annotations_
69
#endif
70
71
#ifndef _Out_
72
#define _Out_
73
#endif
74
#ifndef _Out_opt_
75
#define _Out_opt_
76
#endif
77
#ifndef _Out_z_cap_
78
#define _Out_z_cap_(p)
79
#endif
80
#ifndef _Out_writes_
81
#define _Out_writes_(p)
82
#endif
83
#ifndef _Out_writes_bytes_
84
#define _Out_writes_bytes_(p)
85
#endif
86
#ifndef _Out_writes_z_
87
#define _Out_writes_z_(p)
88
#endif
89
#ifndef _Out_writes_bytes_to_opt_
90
#define _Out_writes_bytes_to_opt_(p, q)
91
#endif
92
93
#ifndef _Success_
94
#define _Success_(p)
95
#endif
96
#ifndef _Ret_maybenull_z_
97
#define _Ret_maybenull_z_
98
#endif
99
#ifndef _Ret_notnull_
100
#define _Ret_notnull_
101
#endif
102
#ifndef _Ret_z_
103
#define _Ret_z_
104
#endif
105
#ifndef _Must_inspect_result_
106
#define _Must_inspect_result_
107
#endif
108
#ifndef _Check_return_
109
#define _Check_return_
110
#endif
111
#ifndef _Post_maybez_
112
#define _Post_maybez_
113
#endif
114
115
#ifndef _Analysis_assume_
116
#define _Analysis_assume_(p)
117
#endif
118
119
#ifndef _Likely_
120
#if _HAS_CXX20
121
#define _Likely_ [[likely]]
122
#else
123
#define _Likely_
124
#endif
125
#endif
126
127
#ifndef _Unlikely_
128
#if _HAS_CXX20
129
#define _Unlikely_ [[unlikely]]
130
#else
131
#define _Unlikely_
132
#endif
133
#endif
134
135
#ifdef _MSC_VER
136
#define _Deprecated_(message) __declspec(deprecated(message))
137
#else
138
#define _Deprecated_(message) [[deprecated(message)]]
139
#endif
140
141
#ifdef _WIN32
142
#define _Unreferenced_(x) UNREFERENCED_PARAMETER(x)
143
#else
144
#define _Unreferenced_(x)
145
#endif
146
147
#ifndef _WIN32
148
template
<
typename
T,
size_t
N>
149
size_t
_countof(T (&arr)[N])
150
{
151
return
std::extent<T[N]>::value;
152
}
153
#endif
154
155
#ifdef __APPLE__
156
#define off64_t off_t
157
#define lseek64 lseek
158
#define lockf64 lockf
159
#define ftruncate64 ftruncate
160
#endif
161
Generated on Tue Sep 12 2023 15:04:54 for stdex by
1.9.8