From 806272ec97274a659febe4d82655eb1916c8f8fa Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 1 Jun 2022 13:33:48 +0200 Subject: [PATCH] c99_compat.h: remove inline and __func__ shims We're requiring C11 now, and both "inline" and __func__ is supported in C++ code as well. So no need for these compatibility-shims anymore. Reviewed-by: Jesse Natalie Reviewed-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Part-of: --- include/c99_compat.h | 50 -------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/include/c99_compat.h b/include/c99_compat.h index ab1ec53a03b..ae9e3235c95 100644 --- a/include/c99_compat.h +++ b/include/c99_compat.h @@ -38,16 +38,6 @@ # if _MSC_VER < 1900 # error "Microsoft Visual Studio 2015 or higher required" -# endif - - /* - * Visual Studio will complain if we define the `inline` keyword, but - * actually it only supports the keyword on C++. - * - * To avoid this the _ALLOW_KEYWORD_MACROS must be set. - */ -# if !defined(_ALLOW_KEYWORD_MACROS) -# define _ALLOW_KEYWORD_MACROS # endif /* @@ -65,30 +55,6 @@ #endif -/* - * C99 inline keyword - */ -#ifndef inline -# ifdef __cplusplus - /* C++ supports inline keyword */ -# elif defined(__GNUC__) -# define inline __inline__ -# elif defined(_MSC_VER) -# define inline __inline -# elif defined(__ICL) -# define inline __inline -# elif defined(__INTEL_COMPILER) - /* Intel compiler supports inline keyword */ -# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) -# define inline __inline -# elif (__STDC_VERSION__ >= 199901L) - /* C99 supports inline keyword */ -# else -# define inline -# endif -#endif - - /* * C99 restrict keyword * @@ -108,22 +74,6 @@ #endif -/* - * C99 __func__ macro - */ -#ifndef __func__ -# if (__STDC_VERSION__ >= 199901L) - /* C99 */ -# elif defined(__GNUC__) -# define __func__ __FUNCTION__ -# elif defined(_MSC_VER) -# define __func__ __FUNCTION__ -# else -# define __func__ "" -# endif -#endif - - /* Simple test case for debugging */ #if 0 static inline const char *