From: Karel Zak Date: Fri, 22 Jan 2021 12:28:02 +0000 (+0100) Subject: build-sys: add restrict keyword fallback X-Git-Tag: v2.37-rc1~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7397f2c1f955569743c68c900ca873fd9e211833;p=thirdparty%2Futil-linux.git build-sys: add restrict keyword fallback Signed-off-by: Karel Zak --- diff --git a/include/c.h b/include/c.h index ae08131099..6b742512b3 100644 --- a/include/c.h +++ b/include/c.h @@ -64,6 +64,21 @@ # define ignore_result(x) ((void) (x)) #endif /* !__GNUC__ */ + +/* "restrict" keyword fallback */ +#if __STDC__ != 1 +# define restrict __restrict /* use implementation __ format */ +#else +# ifndef __STDC_VERSION__ +# define restrict __restrict /* use implementation __ format */ +# else +# if __STDC_VERSION__ < 199901L +# define restrict __restrict /* use implementation __ format */ +# endif +# endif +#endif + + /* * It evaluates to 1 if the attribute/feature is supported by the current * compilation target. Fallback for old compilers.