blob: e011f5c712fdfd1ad450f0483d0ab3aab4d1641a [file] [log] [blame]
Andrew Geissler615f2f12022-07-15 14:00:58 -05001From 5429b9e343c808951b1418d8626e544c9dcb28de Mon Sep 17 00:00:00 2001
2From: Steffen Nurpmeso <steffen@sdaoden.eu>
3Date: Thu, 9 Jun 2022 18:06:04 +0800
4Subject: [PATCH] su_INLINE: gcc: only GNU specifics after -Og
5
6Upstream-Status: Backport[https://git.sdaoden.eu/browse/s-nail.git/commit/?id=c5544b66c3b4b2e161166562349908a07e324b38]
7
8Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
9---
10 include/su/code.h | 17 +++++++++--------
11 1 file changed, 9 insertions(+), 8 deletions(-)
12
13diff --git a/include/su/code.h b/include/su/code.h
14index 4d552c1..9683f4a 100644
15--- a/include/su/code.h
16+++ b/include/su/code.h
17@@ -309,16 +309,17 @@ do{\
18 # define su_INLINE inline
19 # define su_SINLINE inline
20 # elif su_CC_GCC
21- /* After lots of trouble with OpenBSD/gcc 4.2.1 and SunOS/gcc 3.4.3 */
22-# if !su_CC_VCHECK_GCC(3, 2) /* Unsure: only used C++ at that time */
23-# define su_INLINE extern __inline
24-# define su_SINLINE static __inline
25-# elif !su_CC_VCHECK_GCC(4, 3)
26+# if !su_CC_VCHECK_GCC(3, 1)
27+# define su_INLINE extern __inline__
28+# define su_SINLINE static __inline__
29+# elif !defined __GNUC_GNU_INLINE__ /*4.1.3; !su_CC_VCHECK_GCC(4, 2)*/
30 # define su_INLINE extern __inline __attribute__((always_inline))
31 # define su_SINLINE static __inline __attribute__((always_inline))
32- /* xxx gcc 8.3.0 bug: does not truly inline with -Os */
33-# elif !su_CC_VCHECK_GCC(8, 3) || !defined __OPTIMIZE__ ||\
34- !defined __STDC_VERSION__ || __STDC_VERSION__ +0 < 199901L
35+ /* gcc 8.3.0 bug: does not gracefully inline with -Os
36+ * gcc 12.1.0 bug: ditto, -Og
37+ * Thus: always gcc-specific! */
38+# elif 1 /*!defined __OPTIMIZE__ || \
39+ !defined __STDC_VERSION__ || __STDC_VERSION__ +0 < 199901L*/
40 # define su_INLINE extern __inline __attribute__((gnu_inline))
41 # define su_SINLINE static __inline __attribute__((gnu_inline))
42 # elif !defined NDEBUG || !defined __OPTIMIZE__
43--
442.25.1
45