Coverage Report

Created: 2026-11-10 06:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/FreeRDP/winpr/include/winpr/spec.h
Line
Count
Source
1
/**
2
 * WinPR: Windows Portable Runtime
3
 * Compiler Specification Strings
4
 *
5
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *     http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
19
20
#ifndef WINPR_SPEC_H
21
#define WINPR_SPEC_H
22
23
#include <winpr/platform.h>
24
25
WINPR_PRAGMA_DIAG_PUSH
26
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
27
WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
28
29
#ifdef _WIN32
30
31
#include <specstrings.h>
32
#ifndef _COM_Outptr_
33
#define _COM_Outptr_
34
#endif
35
36
#else
37
38
#if defined(NONAMELESSUNION)
39
0
#define DUMMYUNIONNAME u
40
#define DUMMYUNIONNAME1 u1
41
#define DUMMYUNIONNAME2 u2
42
#define DUMMYUNIONNAME3 u3
43
#define DUMMYUNIONNAME4 u4
44
#define DUMMYUNIONNAME5 u5
45
#define DUMMYUNIONNAME6 u6
46
#define DUMMYUNIONNAME7 u7
47
#define DUMMYUNIONNAME8 u8
48
49
0
#define DUMMYSTRUCTNAME s
50
#define DUMMYSTRUCTNAME1 s1
51
#define DUMMYSTRUCTNAME2 s2
52
#define DUMMYSTRUCTNAME3 s3
53
#define DUMMYSTRUCTNAME4 s4
54
#define DUMMYSTRUCTNAME5 s5
55
#else
56
#define DUMMYUNIONNAME
57
#define DUMMYUNIONNAME1
58
#define DUMMYUNIONNAME2
59
#define DUMMYUNIONNAME3
60
#define DUMMYUNIONNAME4
61
#define DUMMYUNIONNAME5
62
#define DUMMYUNIONNAME6
63
#define DUMMYUNIONNAME7
64
#define DUMMYUNIONNAME8
65
66
#define DUMMYSTRUCTNAME
67
#define DUMMYSTRUCTNAME1
68
#define DUMMYSTRUCTNAME2
69
#define DUMMYSTRUCTNAME3
70
#define DUMMYSTRUCTNAME4
71
#define DUMMYSTRUCTNAME5
72
#endif
73
74
#if (defined(_M_AMD64) || defined(_M_ARM)) && !defined(_WIN32)
75
// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
76
#define _UNALIGNED __unaligned
77
#else
78
#define _UNALIGNED
79
#endif
80
81
#ifndef DECLSPEC_ALIGN
82
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
83
#define DECLSPEC_ALIGN(x) __declspec(align(x))
84
#elif defined(__GNUC__)
85
#if defined(__cplusplus) && (__cplusplus >= 201703L)
86
#define DECLSPEC_ALIGN(x) [[gnu::aligned(x)]]
87
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
88
#define DECLSPEC_ALIGN(x) [[gnu::aligned(x)]]
89
#else
90
#define DECLSPEC_ALIGN(x) __attribute__((__aligned__(x)))
91
#endif
92
#else
93
#define DECLSPEC_ALIGN(x)
94
#endif
95
#endif /* DECLSPEC_ALIGN */
96
97
#ifdef _M_AMD64
98
0
#define MEMORY_ALLOCATION_ALIGNMENT 16
99
#else
100
#define MEMORY_ALLOCATION_ALIGNMENT 8
101
#endif
102
103
#ifdef __GNUC__
104
#ifndef __declspec
105
// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
106
#define __declspec(e) __attribute__((e))
107
#endif
108
#endif
109
110
#ifndef DECLSPEC_NORETURN
111
#define DECLSPEC_NORETURN WINPR_DECLSPEC_NORETURN
112
#endif /* DECLSPEC_NORETURN */
113
114
/**
115
 * Header Annotations:
116
 * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383701/
117
 */
118
119
// NOLINTBEGIN(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
120
#define __field_bcount(size) __notnull __byte_writableTo(size)
121
#define __field_ecount(size) __notnull __elem_writableTo(size)
122
#define __post_invalid _Post_ __notvalid
123
124
#define __deref_in
125
#define __deref_in_ecount(size)
126
#define __deref_in_bcount(size)
127
#define __deref_in_opt
128
#define __deref_in_ecount_opt(size)
129
#define __deref_in_bcount_opt(size)
130
#define __deref_opt_in
131
#define __deref_opt_in_ecount(size)
132
#define __deref_opt_in_bcount(size)
133
#define __deref_opt_in_opt
134
#define __deref_opt_in_ecount_opt(size)
135
#define __deref_opt_in_bcount_opt(size)
136
#define __out_awcount(expr, size)
137
#define __in_awcount(expr, size)
138
#define __nullnullterminated
139
#define __in_data_source(src_sym)
140
#define __kernel_entry
141
#define __out_data_source(src_sym)
142
#define __analysis_noreturn
143
#define _Check_return_opt_
144
#define _Check_return_wat_
145
146
#define __inner_exceptthat
147
#define __inner_typefix(ctype)
148
#define _Always_(annos)
149
#define _Analysis_noreturn_
150
#define _Analysis_assume_(expr)
151
#define _At_(target, annos)
152
#define _At_buffer_(target, iter, bound, annos)
153
#define _Check_return_
154
#define _COM_Outptr_
155
#define _COM_Outptr_opt_
156
#define _COM_Outptr_opt_result_maybenull_
157
#define _COM_Outptr_result_maybenull_
158
#define _Const_
159
#define _Deref_in_bound_
160
#define _Deref_in_range_(lb, ub)
161
#define _Deref_inout_bound_
162
#define _Deref_inout_z_
163
#define _Deref_inout_z_bytecap_c_(size)
164
#define _Deref_inout_z_cap_c_(size)
165
#define _Deref_opt_out_
166
#define _Deref_opt_out_opt_
167
#define _Deref_opt_out_opt_z_
168
#define _Deref_opt_out_z_
169
#define _Deref_out_
170
#define _Deref_out_bound_
171
#define _Deref_out_opt_
172
#define _Deref_out_opt_z_
173
#define _Deref_out_range_(lb, ub)
174
#define _Deref_out_z_
175
#define _Deref_out_z_bytecap_c_(size)
176
#define _Deref_out_z_cap_c_(size)
177
#define _Deref_post_bytecap_(size)
178
#define _Deref_post_bytecap_c_(size)
179
#define _Deref_post_bytecap_x_(size)
180
#define _Deref_post_bytecount_(size)
181
#define _Deref_post_bytecount_c_(size)
182
#define _Deref_post_bytecount_x_(size)
183
#define _Deref_post_cap_(size)
184
#define _Deref_post_cap_c_(size)
185
#define _Deref_post_cap_x_(size)
186
#define _Deref_post_count_(size)
187
#define _Deref_post_count_c_(size)
188
#define _Deref_post_count_x_(size)
189
#define _Deref_post_maybenull_
190
#define _Deref_post_notnull_
191
#define _Deref_post_null_
192
#define _Deref_post_opt_bytecap_(size)
193
#define _Deref_post_opt_bytecap_c_(size)
194
#define _Deref_post_opt_bytecap_x_(size)
195
#define _Deref_post_opt_bytecount_(size)
196
#define _Deref_post_opt_bytecount_c_(size)
197
#define _Deref_post_opt_bytecount_x_(size)
198
#define _Deref_post_opt_cap_(size)
199
#define _Deref_post_opt_cap_c_(size)
200
#define _Deref_post_opt_cap_x_(size)
201
#define _Deref_post_opt_count_(size)
202
#define _Deref_post_opt_count_c_(size)
203
#define _Deref_post_opt_count_x_(size)
204
#define _Deref_post_opt_valid_
205
#define _Deref_post_opt_valid_bytecap_(size)
206
#define _Deref_post_opt_valid_bytecap_c_(size)
207
#define _Deref_post_opt_valid_bytecap_x_(size)
208
#define _Deref_post_opt_valid_cap_(size)
209
#define _Deref_post_opt_valid_cap_c_(size)
210
#define _Deref_post_opt_valid_cap_x_(size)
211
#define _Deref_post_opt_z_
212
#define _Deref_post_opt_z_bytecap_(size)
213
#define _Deref_post_opt_z_bytecap_c_(size)
214
#define _Deref_post_opt_z_bytecap_x_(size)
215
#define _Deref_post_opt_z_cap_(size)
216
#define _Deref_post_opt_z_cap_c_(size)
217
#define _Deref_post_opt_z_cap_x_(size)
218
#define _Deref_post_valid_
219
#define _Deref_post_valid_bytecap_(size)
220
#define _Deref_post_valid_bytecap_c_(size)
221
#define _Deref_post_valid_bytecap_x_(size)
222
#define _Deref_post_valid_cap_(size)
223
#define _Deref_post_valid_cap_c_(size)
224
#define _Deref_post_valid_cap_x_(size)
225
#define _Deref_post_z_
226
#define _Deref_post_z_bytecap_(size)
227
#define _Deref_post_z_bytecap_c_(size)
228
#define _Deref_post_z_bytecap_x_(size)
229
#define _Deref_post_z_cap_(size)
230
#define _Deref_post_z_cap_c_(size)
231
#define _Deref_post_z_cap_x_(size)
232
#define _Deref_pre_bytecap_(size)
233
#define _Deref_pre_bytecap_c_(size)
234
#define _Deref_pre_bytecap_x_(size)
235
#define _Deref_pre_bytecount_(size)
236
#define _Deref_pre_bytecount_c_(size)
237
#define _Deref_pre_bytecount_x_(size)
238
#define _Deref_pre_cap_(size)
239
#define _Deref_pre_cap_c_(size)
240
#define _Deref_pre_cap_x_(size)
241
#define _Deref_pre_count_(size)
242
#define _Deref_pre_count_c_(size)
243
#define _Deref_pre_count_x_(size)
244
#define _Deref_pre_invalid_
245
#define _Deref_pre_maybenull_
246
#define _Deref_pre_notnull_
247
#define _Deref_pre_null_
248
#define _Deref_pre_opt_bytecap_(size)
249
#define _Deref_pre_opt_bytecap_c_(size)
250
#define _Deref_pre_opt_bytecap_x_(size)
251
#define _Deref_pre_opt_bytecount_(size)
252
#define _Deref_pre_opt_bytecount_c_(size)
253
#define _Deref_pre_opt_bytecount_x_(size)
254
#define _Deref_pre_opt_cap_(size)
255
#define _Deref_pre_opt_cap_c_(size)
256
#define _Deref_pre_opt_cap_x_(size)
257
#define _Deref_pre_opt_count_(size)
258
#define _Deref_pre_opt_count_c_(size)
259
#define _Deref_pre_opt_count_x_(size)
260
#define _Deref_pre_opt_valid_
261
#define _Deref_pre_opt_valid_bytecap_(size)
262
#define _Deref_pre_opt_valid_bytecap_c_(size)
263
#define _Deref_pre_opt_valid_bytecap_x_(size)
264
#define _Deref_pre_opt_valid_cap_(size)
265
#define _Deref_pre_opt_valid_cap_c_(size)
266
#define _Deref_pre_opt_valid_cap_x_(size)
267
#define _Deref_pre_opt_z_
268
#define _Deref_pre_opt_z_bytecap_(size)
269
#define _Deref_pre_opt_z_bytecap_c_(size)
270
#define _Deref_pre_opt_z_bytecap_x_(size)
271
#define _Deref_pre_opt_z_cap_(size)
272
#define _Deref_pre_opt_z_cap_c_(size)
273
#define _Deref_pre_opt_z_cap_x_(size)
274
#define _Deref_pre_readonly_
275
#define _Deref_pre_valid_
276
#define _Deref_pre_valid_bytecap_(size)
277
#define _Deref_pre_valid_bytecap_c_(size)
278
#define _Deref_pre_valid_bytecap_x_(size)
279
#define _Deref_pre_valid_cap_(size)
280
#define _Deref_pre_valid_cap_c_(size)
281
#define _Deref_pre_valid_cap_x_(size)
282
#define _Deref_pre_writeonly_
283
#define _Deref_pre_z_
284
#define _Deref_pre_z_bytecap_(size)
285
#define _Deref_pre_z_bytecap_c_(size)
286
#define _Deref_pre_z_bytecap_x_(size)
287
#define _Deref_pre_z_cap_(size)
288
#define _Deref_pre_z_cap_c_(size)
289
#define _Deref_pre_z_cap_x_(size)
290
#define _Deref_prepost_bytecap_(size)
291
#define _Deref_prepost_bytecap_x_(size)
292
#define _Deref_prepost_bytecount_(size)
293
#define _Deref_prepost_bytecount_x_(size)
294
#define _Deref_prepost_cap_(size)
295
#define _Deref_prepost_cap_x_(size)
296
#define _Deref_prepost_count_(size)
297
#define _Deref_prepost_count_x_(size)
298
#define _Deref_prepost_opt_bytecap_(size)
299
#define _Deref_prepost_opt_bytecap_x_(size)
300
#define _Deref_prepost_opt_bytecount_(size)
301
#define _Deref_prepost_opt_bytecount_x_(size)
302
#define _Deref_prepost_opt_cap_(size)
303
#define _Deref_prepost_opt_cap_x_(size)
304
#define _Deref_prepost_opt_count_(size)
305
#define _Deref_prepost_opt_count_x_(size)
306
#define _Deref_prepost_opt_valid_
307
#define _Deref_prepost_opt_valid_bytecap_(size)
308
#define _Deref_prepost_opt_valid_bytecap_x_(size)
309
#define _Deref_prepost_opt_valid_cap_(size)
310
#define _Deref_prepost_opt_valid_cap_x_(size)
311
#define _Deref_prepost_opt_z_
312
#define _Deref_prepost_opt_z_bytecap_(size)
313
#define _Deref_prepost_opt_z_cap_(size)
314
#define _Deref_prepost_valid_
315
#define _Deref_prepost_valid_bytecap_(size)
316
#define _Deref_prepost_valid_bytecap_x_(size)
317
#define _Deref_prepost_valid_cap_(size)
318
#define _Deref_prepost_valid_cap_x_(size)
319
#define _Deref_prepost_z_
320
#define _Deref_prepost_z_bytecap_(size)
321
#define _Deref_prepost_z_cap_(size)
322
#define _Deref_ret_bound_
323
#define _Deref_ret_opt_z_
324
#define _Deref_ret_range_(lb, ub)
325
#define _Deref_ret_z_
326
#define _Deref2_pre_readonly_
327
#define _Field_range_(min, max)
328
#define _Field_size_(size)
329
#define _Field_size_bytes_(size)
330
#define _Field_size_bytes_full_(size)
331
#define _Field_size_bytes_full_opt_(size)
332
#define _Field_size_bytes_opt_(size)
333
#define _Field_size_bytes_part_(size, count)
334
#define _Field_size_bytes_part_opt_(size, count)
335
#define _Field_size_full_(size)
336
#define _Field_size_full_opt_(size)
337
#define _Field_size_opt_(size)
338
#define _Field_size_part_(size, count)
339
#define _Field_size_part_opt_(size, count)
340
#define _Field_z_
341
#define _Function_class_(x)
342
#define _Group_(annos)
343
#define _In_
344
#define _In_bound_
345
#define _In_bytecount_(size)
346
#define _In_bytecount_c_(size)
347
#define _In_bytecount_x_(size)
348
#define _In_count_(size)
349
#define _In_count_c_(size)
350
#define _In_count_x_(size)
351
#define _In_defensive_(annotates)
352
#define _In_opt_
353
#define _In_opt_bytecount_(size)
354
#define _In_opt_bytecount_c_(size)
355
#define _In_opt_bytecount_x_(size)
356
#define _In_opt_count_(size)
357
#define _In_opt_count_c_(size)
358
#define _In_opt_count_x_(size)
359
#define _In_opt_ptrdiff_count_(size)
360
#define _In_opt_z_
361
#define _In_opt_z_bytecount_(size)
362
#define _In_opt_z_bytecount_c_(size)
363
#define _In_opt_z_count_(size)
364
#define _In_opt_z_count_c_(size)
365
#define _In_ptrdiff_count_(size)
366
#define _In_range_(lb, ub)
367
#define _In_reads_(size)
368
#define _In_reads_bytes_(size)
369
#define _In_reads_bytes_opt_(size)
370
#define _In_reads_opt_(size)
371
#define _In_reads_opt_z_(size)
372
#define _In_reads_or_z_(size)
373
#define _In_reads_to_ptr_(ptr)
374
#define _In_reads_to_ptr_opt_(ptr)
375
#define _In_reads_to_ptr_opt_z_(ptr)
376
#define _In_reads_to_ptr_z_(ptr)
377
#define _In_reads_z_(size)
378
#define _In_z_
379
#define _In_z_bytecount_(size)
380
#define _In_z_bytecount_c_(size)
381
#define _In_z_count_(size)
382
#define _In_z_count_c_(size)
383
#define _Inout_
384
#define _Inout_bytecap_(size)
385
#define _Inout_bytecap_c_(size)
386
#define _Inout_bytecap_x_(size)
387
#define _Inout_bytecount_(size)
388
#define _Inout_bytecount_c_(size)
389
#define _Inout_bytecount_x_(size)
390
#define _Inout_cap_(size)
391
#define _Inout_cap_c_(size)
392
#define _Inout_cap_x_(size)
393
#define _Inout_count_(size)
394
#define _Inout_count_c_(size)
395
#define _Inout_count_x_(size)
396
#define _Inout_defensive_(annotates)
397
#define _Inout_opt_
398
#define _Inout_opt_bytecap_(size)
399
#define _Inout_opt_bytecap_c_(size)
400
#define _Inout_opt_bytecap_x_(size)
401
#define _Inout_opt_bytecount_(size)
402
#define _Inout_opt_bytecount_c_(size)
403
#define _Inout_opt_bytecount_x_(size)
404
#define _Inout_opt_cap_(size)
405
#define _Inout_opt_cap_c_(size)
406
#define _Inout_opt_cap_x_(size)
407
#define _Inout_opt_count_(size)
408
#define _Inout_opt_count_c_(size)
409
#define _Inout_opt_count_x_(size)
410
#define _Inout_opt_ptrdiff_count_(size)
411
#define _Inout_opt_z_
412
#define _Inout_opt_z_bytecap_(size)
413
#define _Inout_opt_z_bytecap_c_(size)
414
#define _Inout_opt_z_bytecap_x_(size)
415
#define _Inout_opt_z_bytecount_(size)
416
#define _Inout_opt_z_bytecount_c_(size)
417
#define _Inout_opt_z_cap_(size)
418
#define _Inout_opt_z_cap_c_(size)
419
#define _Inout_opt_z_cap_x_(size)
420
#define _Inout_opt_z_count_(size)
421
#define _Inout_opt_z_count_c_(size)
422
#define _Inout_ptrdiff_count_(size)
423
#define _Inout_updates_(size)
424
#define _Inout_updates_all_(size)
425
#define _Inout_updates_all_opt_(size)
426
#define _Inout_updates_bytes_(size)
427
#define _Inout_updates_bytes_all_(size)
428
#define _Inout_updates_bytes_all_opt_(size)
429
#define _Inout_updates_bytes_opt_(size)
430
#define _Inout_updates_bytes_to_(size, count)
431
#define _Inout_updates_bytes_to_opt_(size, count)
432
#define _Inout_updates_opt_(size)
433
#define _Inout_updates_opt_z_(size)
434
#define _Inout_updates_to_(size, count)
435
#define _Inout_updates_to_opt_(size, count)
436
#define _Inout_updates_z_(size)
437
#define _Inout_z_
438
#define _Inout_z_bytecap_(size)
439
#define _Inout_z_bytecap_c_(size)
440
#define _Inout_z_bytecap_x_(size)
441
#define _Inout_z_bytecount_(size)
442
#define _Inout_z_bytecount_c_(size)
443
#define _Inout_z_cap_(size)
444
#define _Inout_z_cap_c_(size)
445
#define _Inout_z_cap_x_(size)
446
#define _Inout_z_count_(size)
447
#define _Inout_z_count_c_(size)
448
#define _Interlocked_operand_
449
#define _Literal_
450
#define _Maybenull_
451
#define _Maybevalid_
452
#define _Maybe_raises_SEH_exception
453
#define _Must_inspect_result_
454
#define _Notliteral_
455
#define _Notnull_
456
#define _Notref_
457
#define _Notvalid_
458
#define _Null_
459
#define _Null_terminated_
460
#define _NullNull_terminated_
461
#define _On_failure_(annos)
462
#define _Out_
463
#define _Out_bound_
464
#define _Out_bytecap_(size)
465
#define _Out_bytecap_c_(size)
466
#define _Out_bytecap_post_bytecount_(cap, count)
467
#define _Out_bytecap_x_(size)
468
#define _Out_bytecapcount_(capcount)
469
#define _Out_bytecapcount_x_(capcount)
470
#define _Out_cap_(size)
471
#define _Out_cap_c_(size)
472
#define _Out_cap_m_(mult, size)
473
#define _Out_cap_post_count_(cap, count)
474
#define _Out_cap_x_(size)
475
#define _Out_capcount_(capcount)
476
#define _Out_capcount_x_(capcount)
477
#define _Out_defensive_(annotates)
478
#define _Out_opt_
479
#define _Out_opt_bytecap_(size)
480
#define _Out_opt_bytecap_c_(size)
481
#define _Out_opt_bytecap_post_bytecount_(cap, count)
482
#define _Out_opt_bytecap_x_(size)
483
#define _Out_opt_bytecapcount_(capcount)
484
#define _Out_opt_bytecapcount_x_(capcount)
485
#define _Out_opt_cap_(size)
486
#define _Out_opt_cap_c_(size)
487
#define _Out_opt_cap_m_(mult, size)
488
#define _Out_opt_cap_post_count_(cap, count)
489
#define _Out_opt_cap_x_(size)
490
#define _Out_opt_capcount_(capcount)
491
#define _Out_opt_capcount_x_(capcount)
492
#define _Out_opt_ptrdiff_cap_(size)
493
#define _Out_opt_z_bytecap_(size)
494
#define _Out_opt_z_bytecap_c_(size)
495
#define _Out_opt_z_bytecap_post_bytecount_(cap, count)
496
#define _Out_opt_z_bytecap_x_(size)
497
#define _Out_opt_z_bytecapcount_(capcount)
498
#define _Out_opt_z_cap_(size)
499
#define _Out_opt_z_cap_c_(size)
500
#define _Out_opt_z_cap_m_(mult, size)
501
#define _Out_opt_z_cap_post_count_(cap, count)
502
#define _Out_opt_z_cap_x_(size)
503
#define _Out_opt_z_capcount_(capcount)
504
#define _Out_ptrdiff_cap_(size)
505
#define _Out_range_(lb, ub)
506
#define _Out_writes_(size)
507
#define _Out_writes_all_(size)
508
#define _Out_writes_all_opt_(size)
509
#define _Out_writes_bytes_(size)
510
#define _Out_writes_bytes_all_(size)
511
#define _Out_writes_bytes_all_opt_(size)
512
#define _Out_writes_bytes_opt_(size)
513
#define _Out_writes_bytes_to_(size, count)
514
#define _Out_writes_bytes_to_opt_(size, count)
515
#define _Out_writes_opt_(size)
516
#define _Out_writes_opt_z_(size)
517
#define _Out_writes_to_(size, count)
518
#define _Out_writes_to_opt_(size, count)
519
#define _Out_writes_to_ptr_(ptr)
520
#define _Out_writes_to_ptr_opt_(ptr)
521
#define _Out_writes_to_ptr_opt_z_(ptr)
522
#define _Out_writes_to_ptr_z_(ptr)
523
#define _Out_writes_z_(size)
524
#define _Out_z_bytecap_(size)
525
#define _Out_z_bytecap_c_(size)
526
#define _Out_z_bytecap_post_bytecount_(cap, count)
527
#define _Out_z_bytecap_x_(size)
528
#define _Out_z_bytecapcount_(capcount)
529
#define _Out_z_cap_(size)
530
#define _Out_z_cap_c_(size)
531
#define _Out_z_cap_m_(mult, size)
532
#define _Out_z_cap_post_count_(cap, count)
533
#define _Out_z_cap_x_(size)
534
#define _Out_z_capcount_(capcount)
535
#define _Outptr_
536
#define _Outptr_opt_
537
#define _Outptr_opt_result_buffer_(size)
538
#define _Outptr_opt_result_buffer_all_(size)
539
#define _Outptr_opt_result_buffer_all_maybenull_(size)
540
#define _Outptr_opt_result_buffer_maybenull_(size)
541
#define _Outptr_opt_result_buffer_to_(size, count)
542
#define _Outptr_opt_result_buffer_to_maybenull_(size, count)
543
#define _Outptr_opt_result_bytebuffer_(size)
544
#define _Outptr_opt_result_bytebuffer_all_(size)
545
#define _Outptr_opt_result_bytebuffer_all_maybenull_(size)
546
#define _Outptr_opt_result_bytebuffer_maybenull_(size)
547
#define _Outptr_opt_result_bytebuffer_to_(size, count)
548
#define _Outptr_opt_result_bytebuffer_to_maybenull_(size, count)
549
#define _Outptr_opt_result_maybenull_
550
#define _Outptr_opt_result_maybenull_z_
551
#define _Outptr_opt_result_nullonfailure_
552
#define _Outptr_opt_result_z_
553
#define _Outptr_result_buffer_(size)
554
#define _Outptr_result_buffer_all_(size)
555
#define _Outptr_result_buffer_all_maybenull_(size)
556
#define _Outptr_result_buffer_maybenull_(size)
557
#define _Outptr_result_buffer_to_(size, count)
558
#define _Outptr_result_buffer_to_maybenull_(size, count)
559
#define _Outptr_result_bytebuffer_(size)
560
#define _Outptr_result_bytebuffer_all_(size)
561
#define _Outptr_result_bytebuffer_all_maybenull_(size)
562
#define _Outptr_result_bytebuffer_maybenull_(size)
563
#define _Outptr_result_bytebuffer_to_(size, count)
564
#define _Outptr_result_bytebuffer_to_maybenull_(size, count)
565
#define _Outptr_result_maybenull_
566
#define _Outptr_result_maybenull_z_
567
#define _Outptr_result_nullonfailure_
568
#define _Outptr_result_z_
569
#define _Outref_
570
#define _Outref_result_buffer_(size)
571
#define _Outref_result_buffer_all_(size)
572
#define _Outref_result_buffer_all_maybenull_(size)
573
#define _Outref_result_buffer_maybenull_(size)
574
#define _Outref_result_buffer_to_(size, count)
575
#define _Outref_result_buffer_to_maybenull_(size, count)
576
#define _Outref_result_bytebuffer_(size)
577
#define _Outref_result_bytebuffer_all_(size)
578
#define _Outref_result_bytebuffer_all_maybenull_(size)
579
#define _Outref_result_bytebuffer_maybenull_(size)
580
#define _Outref_result_bytebuffer_to_(size, count)
581
#define _Outref_result_bytebuffer_to_maybenull_(size, count)
582
#define _Outref_result_maybenull_
583
#define _Outref_result_nullonfailure_
584
#define _Points_to_data_
585
#define _Post_
586
#define _Post_bytecap_(size)
587
#define _Post_bytecount_(size)
588
#define _Post_bytecount_c_(size)
589
#define _Post_bytecount_x_(size)
590
#define _Post_cap_(size)
591
#define _Post_count_(size)
592
#define _Post_count_c_(size)
593
#define _Post_count_x_(size)
594
#define _Post_defensive_
595
#define _Post_equal_to_(expr)
596
#define _Post_invalid_
597
#define _Post_maybenull_
598
#define _Post_maybez_
599
#define _Post_notnull_
600
#define _Post_null_
601
#define _Post_ptr_invalid_
602
#define _Post_readable_byte_size_(size)
603
#define _Post_readable_size_(size)
604
#define _Post_satisfies_(cond)
605
#define _Post_valid_
606
#define _Post_writable_byte_size_(size)
607
#define _Post_writable_size_(size)
608
#define _Post_z_
609
#define _Post_z_bytecount_(size)
610
#define _Post_z_bytecount_c_(size)
611
#define _Post_z_bytecount_x_(size)
612
#define _Post_z_count_(size)
613
#define _Post_z_count_c_(size)
614
#define _Post_z_count_x_(size)
615
#define _Pre_
616
#define _Pre_bytecap_(size)
617
#define _Pre_bytecap_c_(size)
618
#define _Pre_bytecap_x_(size)
619
#define _Pre_bytecount_(size)
620
#define _Pre_bytecount_c_(size)
621
#define _Pre_bytecount_x_(size)
622
#define _Pre_cap_(size)
623
#define _Pre_cap_c_(size)
624
#define _Pre_cap_c_one_
625
#define _Pre_cap_for_(param)
626
#define _Pre_cap_m_(mult, size)
627
#define _Pre_cap_x_(size)
628
#define _Pre_count_(size)
629
#define _Pre_count_c_(size)
630
#define _Pre_count_x_(size)
631
#define _Pre_defensive_
632
#define _Pre_equal_to_(expr)
633
#define _Pre_invalid_
634
#define _Pre_maybenull_
635
#define _Pre_notnull_
636
#define _Pre_null_
637
#define _Pre_opt_bytecap_(size)
638
#define _Pre_opt_bytecap_c_(size)
639
#define _Pre_opt_bytecap_x_(size)
640
#define _Pre_opt_bytecount_(size)
641
#define _Pre_opt_bytecount_c_(size)
642
#define _Pre_opt_bytecount_x_(size)
643
#define _Pre_opt_cap_(size)
644
#define _Pre_opt_cap_c_(size)
645
#define _Pre_opt_cap_c_one_
646
#define _Pre_opt_cap_for_(param)
647
#define _Pre_opt_cap_m_(mult, size)
648
#define _Pre_opt_cap_x_(size)
649
#define _Pre_opt_count_(size)
650
#define _Pre_opt_count_c_(size)
651
#define _Pre_opt_count_x_(size)
652
#define _Pre_opt_ptrdiff_cap_(ptr)
653
#define _Pre_opt_ptrdiff_count_(ptr)
654
#define _Pre_opt_valid_
655
#define _Pre_opt_valid_bytecap_(size)
656
#define _Pre_opt_valid_bytecap_c_(size)
657
#define _Pre_opt_valid_bytecap_x_(size)
658
#define _Pre_opt_valid_cap_(size)
659
#define _Pre_opt_valid_cap_c_(size)
660
#define _Pre_opt_valid_cap_x_(size)
661
#define _Pre_opt_z_
662
#define _Pre_opt_z_bytecap_(size)
663
#define _Pre_opt_z_bytecap_c_(size)
664
#define _Pre_opt_z_bytecap_x_(size)
665
#define _Pre_opt_z_cap_(size)
666
#define _Pre_opt_z_cap_c_(size)
667
#define _Pre_opt_z_cap_x_(size)
668
#define _Pre_ptrdiff_cap_(ptr)
669
#define _Pre_ptrdiff_count_(ptr)
670
#define _Pre_readable_byte_size_(size)
671
#define _Pre_readable_size_(size)
672
#define _Pre_readonly_
673
#define _Pre_satisfies_(cond)
674
#define _Pre_unknown_
675
#define _Pre_valid_
676
#define _Pre_valid_bytecap_(size)
677
#define _Pre_valid_bytecap_c_(size)
678
#define _Pre_valid_bytecap_x_(size)
679
#define _Pre_valid_cap_(size)
680
#define _Pre_valid_cap_c_(size)
681
#define _Pre_valid_cap_x_(size)
682
#define _Pre_writable_byte_size_(size)
683
#define _Pre_writable_size_(size)
684
#define _Pre_writeonly_
685
#define _Pre_z_
686
#define _Pre_z_bytecap_(size)
687
#define _Pre_z_bytecap_c_(size)
688
#define _Pre_z_bytecap_x_(size)
689
#define _Pre_z_cap_(size)
690
#define _Pre_z_cap_c_(size)
691
#define _Pre_z_cap_x_(size)
692
#define _Prepost_bytecount_(size)
693
#define _Prepost_bytecount_c_(size)
694
#define _Prepost_bytecount_x_(size)
695
#define _Prepost_count_(size)
696
#define _Prepost_count_c_(size)
697
#define _Prepost_count_x_(size)
698
#define _Prepost_opt_bytecount_(size)
699
#define _Prepost_opt_bytecount_c_(size)
700
#define _Prepost_opt_bytecount_x_(size)
701
#define _Prepost_opt_count_(size)
702
#define _Prepost_opt_count_c_(size)
703
#define _Prepost_opt_count_x_(size)
704
#define _Prepost_opt_valid_
705
#define _Prepost_opt_z_
706
#define _Prepost_valid_
707
#define _Prepost_z_
708
#define _Printf_format_string_
709
#define _Raises_SEH_exception_
710
#define _Maybe_raises_SEH_exception_
711
#define _Readable_bytes_(size)
712
#define _Readable_elements_(size)
713
#define _Reserved_
714
#define _Result_nullonfailure_
715
#define _Result_zeroonfailure_
716
#define __inner_callback
717
#define _Ret_
718
#define _Ret_bound_
719
#define _Ret_bytecap_(size)
720
#define _Ret_bytecap_c_(size)
721
#define _Ret_bytecap_x_(size)
722
#define _Ret_bytecount_(size)
723
#define _Ret_bytecount_c_(size)
724
#define _Ret_bytecount_x_(size)
725
#define _Ret_cap_(size)
726
#define _Ret_cap_c_(size)
727
#define _Ret_cap_x_(size)
728
#define _Ret_count_(size)
729
#define _Ret_count_c_(size)
730
#define _Ret_count_x_(size)
731
#define _Ret_maybenull_
732
#define _Ret_maybenull_z_
733
#define _Ret_notnull_
734
#define _Ret_null_
735
#define _Ret_opt_
736
#define _Ret_opt_bytecap_(size)
737
#define _Ret_opt_bytecap_c_(size)
738
#define _Ret_opt_bytecap_x_(size)
739
#define _Ret_opt_bytecount_(size)
740
#define _Ret_opt_bytecount_c_(size)
741
#define _Ret_opt_bytecount_x_(size)
742
#define _Ret_opt_cap_(size)
743
#define _Ret_opt_cap_c_(size)
744
#define _Ret_opt_cap_x_(size)
745
#define _Ret_opt_count_(size)
746
#define _Ret_opt_count_c_(size)
747
#define _Ret_opt_count_x_(size)
748
#define _Ret_opt_valid_
749
#define _Ret_opt_z_
750
#define _Ret_opt_z_bytecap_(size)
751
#define _Ret_opt_z_bytecount_(size)
752
#define _Ret_opt_z_cap_(size)
753
#define _Ret_opt_z_count_(size)
754
#define _Ret_range_(lb, ub)
755
#define _Ret_valid_
756
#define _Ret_writes_(size)
757
#define _Ret_writes_bytes_(size)
758
#define _Ret_writes_bytes_maybenull_(size)
759
#define _Ret_writes_bytes_to_(size, count)
760
#define _Ret_writes_bytes_to_maybenull_(size, count)
761
#define _Ret_writes_maybenull_(size)
762
#define _Ret_writes_maybenull_z_(size)
763
#define _Ret_writes_to_(size, count)
764
#define _Ret_writes_to_maybenull_(size, count)
765
#define _Ret_writes_z_(size)
766
#define _Ret_z_
767
#define _Ret_z_bytecap_(size)
768
#define _Ret_z_bytecount_(size)
769
#define _Ret_z_cap_(size)
770
#define _Ret_z_count_(size)
771
#define _Return_type_success_(expr)
772
#define _Scanf_format_string_
773
#define _Scanf_s_format_string_
774
#define _Struct_size_bytes_(size)
775
#define _Success_(expr)
776
#define _Unchanged_(e)
777
#define _Use_decl_annotations_
778
#define _Valid_
779
#define _When_(expr, annos)
780
#define _Writable_bytes_(size)
781
#define _Writable_elements_(size)
782
783
#define __bcount(size)
784
#define __bcount_opt(size)
785
#define __deref_bcount(size)
786
#define __deref_bcount_opt(size)
787
#define __deref_ecount(size)
788
#define __deref_ecount_opt(size)
789
#define __deref_in
790
#define __deref_in_bcount(size)
791
#define __deref_in_bcount_opt(size)
792
#define __deref_in_ecount(size)
793
#define __deref_in_ecount_opt(size)
794
#define __deref_in_opt
795
#define __deref_inout
796
#define __deref_inout_bcount(size)
797
#define __deref_inout_bcount_full(size)
798
#define __deref_inout_bcount_full_opt(size)
799
#define __deref_inout_bcount_opt(size)
800
#define __deref_inout_bcount_part(size, length)
801
#define __deref_inout_bcount_part_opt(size, length)
802
#define __deref_inout_ecount(size)
803
#define __deref_inout_ecount_full(size)
804
#define __deref_inout_ecount_full_opt(size)
805
#define __deref_inout_ecount_opt(size)
806
#define __deref_inout_ecount_part(size, length)
807
#define __deref_inout_ecount_part_opt(size, length)
808
#define __deref_inout_opt
809
#define __deref_opt_bcount(size)
810
#define __deref_opt_bcount_opt(size)
811
#define __deref_opt_ecount(size)
812
#define __deref_opt_ecount_opt(size)
813
#define __deref_opt_in
814
#define __deref_opt_in_bcount(size)
815
#define __deref_opt_in_bcount_opt(size)
816
#define __deref_opt_in_ecount(size)
817
#define __deref_opt_in_ecount_opt(size)
818
#define __deref_opt_in_opt
819
#define __deref_opt_inout
820
#define __deref_opt_inout_bcount(size)
821
#define __deref_opt_inout_bcount_full(size)
822
#define __deref_opt_inout_bcount_full_opt(size)
823
#define __deref_opt_inout_bcount_opt(size)
824
#define __deref_opt_inout_bcount_part(size, length)
825
#define __deref_opt_inout_bcount_part_opt(size, length)
826
#define __deref_opt_inout_ecount(size)
827
#define __deref_opt_inout_ecount_full(size)
828
#define __deref_opt_inout_ecount_full_opt(size)
829
#define __deref_opt_inout_ecount_opt(size)
830
#define __deref_opt_inout_ecount_part(size, length)
831
#define __deref_opt_inout_ecount_part_opt(size, length)
832
#define __deref_opt_inout_opt
833
#define __deref_opt_out
834
#define __deref_opt_out_bcount(size)
835
#define __deref_opt_out_bcount_full(size)
836
#define __deref_opt_out_bcount_full_opt(size)
837
#define __deref_opt_out_bcount_opt(size)
838
#define __deref_opt_out_bcount_part(size, length)
839
#define __deref_opt_out_bcount_part_opt(size, length)
840
#define __deref_opt_out_ecount(size)
841
#define __deref_opt_out_ecount_full(size)
842
#define __deref_opt_out_ecount_full_opt(size)
843
#define __deref_opt_out_ecount_opt(size)
844
#define __deref_opt_out_ecount_part(size, length)
845
#define __deref_opt_out_ecount_part_opt(size, length)
846
#define __deref_opt_out_opt
847
#define __deref_out
848
#define __deref_out_bcount(size)
849
#define __deref_out_bcount_full(size)
850
#define __deref_out_bcount_full_opt(size)
851
#define __deref_out_bcount_opt(size)
852
#define __deref_out_bcount_part(size, length)
853
#define __deref_out_bcount_part_opt(size, length)
854
#define __deref_out_ecount(size)
855
#define __deref_out_ecount_full(size)
856
#define __deref_out_ecount_full_opt(size)
857
#define __deref_out_ecount_opt(size)
858
#define __deref_out_ecount_part(size, length)
859
#define __deref_out_ecount_part_opt(size, length)
860
#define __deref_out_opt
861
#define __ecount(size)
862
#define __ecount_opt(size)
863
// #define __in     /* Conflicts with libstdc++ header macros */
864
#define __in_bcount(size)
865
#define __in_bcount_opt(size)
866
#define __in_ecount(size)
867
#define __in_ecount_opt(size)
868
#define __in_opt
869
#define __inout
870
#define __inout_bcount(size)
871
#define __inout_bcount_full(size)
872
#define __inout_bcount_full_opt(size)
873
#define __inout_bcount_opt(size)
874
#define __inout_bcount_part(size, length)
875
#define __inout_bcount_part_opt(size, length)
876
#define __inout_ecount(size)
877
#define __inout_ecount_full(size)
878
#define __inout_ecount_full_opt(size)
879
#define __inout_ecount_opt(size)
880
#define __inout_ecount_part(size, length)
881
#define __inout_ecount_part_opt(size, length)
882
#define __inout_opt
883
// #define __out      /* Conflicts with libstdc++ header macros */
884
#define __out_bcount(size)
885
#define __out_bcount_full(size)
886
#define __out_bcount_full_opt(size)
887
#define __out_bcount_opt(size)
888
#define __out_bcount_part(size, length)
889
#define __out_bcount_part_opt(size, length)
890
#define __out_ecount(size)
891
#define __out_ecount_full(size)
892
#define __out_ecount_full_opt(size)
893
#define __out_ecount_opt(size)
894
#define __out_ecount_part(size, length)
895
#define __out_ecount_part_opt(size, length)
896
#define __out_opt
897
898
#define __blocksOn(resource)
899
#define __callback
900
#define __checkReturn
901
#define __format_string
902
#define __in_awcount(expr, size)
903
#define __nullnullterminated
904
#define __nullterminated
905
#define __out_awcount(expr, size)
906
#define __override
907
// #define __reserved     /* Conflicts with header included by CarbonCore.h on OS X */
908
#define __success(expr)
909
#define __typefix(ctype)
910
911
// NOLINTEND(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
912
913
#ifndef _countof
914
#ifndef __cplusplus
915
#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
916
#else
917
extern "C++"
918
{
919
  template <typename _CountofType, size_t _SizeOfArray>
920
  char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
921
#define _countof(_Array) sizeof(*__countof_helper(_Array))
922
}
923
#endif
924
#endif
925
926
/**
927
 * RTL Definitions
928
 */
929
930
#define MINCHAR 0x80
931
#define MAXCHAR 0x7F
932
933
#ifndef MINSHORT
934
#define MINSHORT 0x8000
935
#endif
936
937
#ifndef MAXSHORT
938
#define MAXSHORT 0x7FFF
939
#endif
940
941
#define MINLONG 0x80000000
942
#define MAXLONG 0x7FFFFFFF
943
#define MAXBYTE 0xFF
944
#define MAXWORD 0xFFFF
945
#define MAXDWORD 0xFFFFFFFF
946
947
#define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR) & (((type*)0)->field))
948
949
#define RTL_FIELD_SIZE(type, field) (sizeof(((type*)0)->field))
950
951
#define RTL_SIZEOF_THROUGH_FIELD(type, field) \
952
  (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
953
954
#define RTL_CONTAINS_FIELD(Struct, Size, Field) \
955
  ((((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct)) + (Size)))
956
957
722k
#define RTL_NUMBER_OF_V1(A) (sizeof(A) / sizeof((A)[0]))
958
722k
#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
959
960
#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A)
961
962
722k
#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
963
// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
964
#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
965
966
#define RTL_FIELD_TYPE(type, field) (((type*)0)->field)
967
968
#define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field)))
969
970
#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2)                                  \
971
  ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1))                               \
972
       ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \
973
       : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2)))
974
975
#if defined(__cplusplus)
976
#define RTL_CONST_CAST(type) const_cast<type>
977
#else
978
#define RTL_CONST_CAST(type) (type)
979
#endif
980
981
#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8)
982
983
#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field)))
984
985
#define CONTAINING_RECORD(address, type, field) \
986
  ((type*)((PCHAR)(address) - (ULONG_PTR)(&((type*)0)->field)))
987
988
#endif
989
990
#if defined(_WIN32) || defined(__CYGWIN__)
991
#ifdef __GNUC__
992
#define DECLSPEC_EXPORT __attribute__((dllexport))
993
#ifndef DECLSPEC_IMPORT
994
#define DECLSPEC_IMPORT __attribute__((dllimport))
995
#endif /* DECLSPEC_IMPORT */
996
#else
997
#define DECLSPEC_EXPORT __declspec(dllexport)
998
#define DECLSPEC_IMPORT __declspec(dllimport)
999
#endif /* __GNUC__ */
1000
#else
1001
#if defined(__GNUC__) && __GNUC__ >= 4
1002
#if defined(__cplusplus) && (__cplusplus >= 201703L)
1003
#define DECLSPEC_EXPORT [[gnu::visibility("default")]]
1004
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
1005
#define DECLSPEC_EXPORT [[gnu::visibility("default")]]
1006
#else
1007
#define DECLSPEC_EXPORT __attribute__((visibility("default")))
1008
#endif
1009
#define DECLSPEC_IMPORT
1010
#else
1011
#define DECLSPEC_EXPORT
1012
#define DECLSPEC_IMPORT
1013
#endif
1014
#endif
1015
1016
WINPR_PRAGMA_DIAG_POP
1017
1018
#endif /* WINPR_SPEC_H */