Mesa (main): c99_compat.h: remove inline and __func__ shims

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 2 13:50:04 UTC 2022


Module: Mesa
Branch: main
Commit: 806272ec97274a659febe4d82655eb1916c8f8fa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=806272ec97274a659febe4d82655eb1916c8f8fa

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Jun  1 13:33:48 2022 +0200

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 <jenatali at microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>

---

 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__ "<unknown>"
-#  endif
-#endif
-
-
 /* Simple test case for debugging */
 #if 0
 static inline const char *



More information about the mesa-commit mailing list