xref: /reactos/sdk/include/vcruntime/gcc_sal.h (revision 84344399)
1 /*
2  * PROJECT:     ReactOS PSDK
3  * LICENSE:     MIT (https://spdx.org/licenses/MIT)
4  * PURPOSE:     Standard Annotation Language (SAL) definitions - GCC overrides
5  * COPYRIGHT:   2021 - Jérôme Gardou
6  */
7 
8 #pragma once
9 
10 #ifndef __GNUC__
11 #error "Not for your compiler!"
12 #endif
13 
14 #ifndef __has_attribute
15 #pragma GCC warning "GCC without __has_attribute, no SAL niceties for you"
16 #define __has_attribute(__x) 0
17 #endif
18 
19 #if __has_attribute(warn_unused_result)
20 # undef _Must_inspect_result_
21 /* FIXME: Not really equivalent */
22 # define _Must_inspect_result_ __attribute__((__warn_unused_result__))
23 # undef _Check_return_
24 /* This one is 1:1 equivalent */
25 # define _Check_return_ __attribute__((__warn_unused_result__))
26 #endif
27