blob: 41f98281f8eceef7287803b35baad51a8b032264 [file] [log] [blame]
Andrew Geissler615f2f12022-07-15 14:00:58 -05001From 9db4c0f6bc0dd11c77b54296fce6b8afe18f4325 Mon Sep 17 00:00:00 2001
2From: Steffen Nurpmeso <steffen@sdaoden.eu>
3Date: Thu, 9 Jun 2022 18:26:38 +0800
4Subject: [PATCH] su_INLINE: eh no; give up, share detection with clang but for
5 a thing
6
Andrew Geisslerc5535c92023-01-27 16:10:19 -06007Upstream-Status: Backport [https://git.sdaoden.eu/browse/s-nail.git/commit/?id=de2a44c393a39d80ddf12154aec94cace84b19c1]
Andrew Geissler615f2f12022-07-15 14:00:58 -05008
9Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
10---
11 include/su/code.h | 34 +++++++++-------------------------
12 1 file changed, 9 insertions(+), 25 deletions(-)
13
14diff --git a/include/su/code.h b/include/su/code.h
15index 9683f4a..c7a2af3 100644
16--- a/include/su/code.h
17+++ b/include/su/code.h
18@@ -308,29 +308,8 @@ do{\
19 # ifdef DOXYGEN
20 # define su_INLINE inline
21 # define su_SINLINE inline
22-# elif su_CC_GCC
23-# if !su_CC_VCHECK_GCC(3, 1)
24-# define su_INLINE extern __inline__
25-# define su_SINLINE static __inline__
26-# elif !defined __GNUC_GNU_INLINE__ /*4.1.3; !su_CC_VCHECK_GCC(4, 2)*/
27-# define su_INLINE extern __inline __attribute__((always_inline))
28-# define su_SINLINE static __inline __attribute__((always_inline))
29- /* gcc 8.3.0 bug: does not gracefully inline with -Os
30- * gcc 12.1.0 bug: ditto, -Og
31- * Thus: always gcc-specific! */
32-# elif 1 /*!defined __OPTIMIZE__ || \
33- !defined __STDC_VERSION__ || __STDC_VERSION__ +0 < 199901L*/
34-# define su_INLINE extern __inline __attribute__((gnu_inline))
35-# define su_SINLINE static __inline __attribute__((gnu_inline))
36-# elif !defined NDEBUG || !defined __OPTIMIZE__
37-# define su_INLINE static inline
38-# define su_SINLINE static inline
39-# else
40-# define su_INLINE inline
41-# define su_SINLINE static inline
42-# endif
43-# elif su_CC_CLANG || su_CC_PCC
44-# if defined __STDC_VERSION__ && __STDC_VERSION__ +0 >= 199901L
45+# elif su_CC_CLANG || su_CC_GCC || su_CC_PCC
46+# if defined __STDC_VERSION__ && __STDC_VERSION__ +0 >= 199901l
47 # if !defined NDEBUG || !defined __OPTIMIZE__
48 # define su_INLINE static inline
49 # define su_SINLINE static inline
50@@ -340,8 +319,13 @@ do{\
51 # define su_SINLINE static inline __attribute__((always_inline))
52 # endif
53 # else
54-# define su_INLINE static __inline
55-# define su_SINLINE static __inline
56+# if su_CC_VCHECK_GCC(3, 1)
57+# define su_INLINE static __inline __attribute__((always_inline))
58+# define su_SINLINE static __inline __attribute__((always_inline))
59+# else
60+# define su_INLINE static __inline
61+# define su_SINLINE static __inline
62+# endif
63 # endif
64 # else
65 # define su_INLINE static /* TODO __attribute__((unused)) alike? */
66--
672.25.1
68