reactos/sdk/include/psdk/gcc_sal.h
Jérôme Gardou d1f5c31820 [SDK] Add GCC overrides for SAL annotations
GCC has some functions, variables & type attributes which can be used as aliases
for some of the SAL annotations. Although it's not as rich & precise, it's still useful
since we actually enable -Werror on GCC builds whereas we don't use such an option
on MSVC builds.

For now, _Must_inspect_result_ is aliased to warn_result_unused attribute.
2021-06-28 10:20:57 +02:00

23 lines
564 B
C

/*
* PROJECT: ReactOS PSDK
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: Standard Annotation Language (SAL) definitions - GCC overrides
* COPYRIGHT: 2021 - Jérôme Gardou
*/
#pragma once
#ifndef __GNUC__
#error "Not for your compiler!"
#endif
#ifndef __has_attribute
#pragma GCC warning "GCC without __has_attribute, no SAL niceties for you"
#define __has_attribute(__x) 0
#endif
#if __has_attribute(warn_unused_result)
# undef _Must_inspect_result_
# define _Must_inspect_result_ __attribute__((__warn_unused_result__))
#endif