]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Assume "inline" keyword is available.
authorNathan Bossart <nathan@postgresql.org>
Thu, 19 Feb 2026 20:37:29 +0000 (14:37 -0600)
committerNathan Bossart <nathan@postgresql.org>
Thu, 19 Feb 2026 20:37:29 +0000 (14:37 -0600)
This has been a keyword since C99, and we now require C11, so we no
longer need to use __inline__ or to check for it at configure time.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/aZdGbDaV4_yKCMc-%40nathan

configure
configure.ac
src/include/pg_config.h.in
src/include/port/atomics/arch-x86.h
src/include/storage/s_lock.h

index a6eab396299de5ca94f98d59d1e32c45fc979588..e1a081299749ba56b75b7b8b37d0829efc247e4a 100755 (executable)
--- a/configure
+++ b/configure
@@ -14741,48 +14741,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C printf format archetype" >&5
 $as_echo_n "checking for C printf format archetype... " >&6; }
 if ${pgac_cv_printf_archetype+:} false; then :
index 455ba31f1d1d5e267a3b42412e0232b9527cf5c3..cc85c233c034127ccea1132bd1f2a8e58deca2b6 100644 (file)
@@ -1712,7 +1712,6 @@ fi
 
 m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that.
 AC_C_BIGENDIAN
-AC_C_INLINE
 PGAC_PRINTF_ARCHETYPE
 PGAC_CXX_PRINTF_ARCHETYPE
 PGAC_C_STATEMENT_EXPRESSIONS
index 339268dc8ef44674370ff8e789a4fe5e25d1dc6f..3824a5571bb63c8db6c2192626812143f57a063b 100644 (file)
 /* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES
 
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
 /* Define to keyword to use for C99 restrict support, or to nothing if not
    supported */
 #undef pg_restrict
index 43a8e90b2d2bed7f9636df5ed0dfa792424c65b9..bd6f4f56ca2cb9c552f175d8fb55d93cedd32f68 100644 (file)
@@ -104,7 +104,7 @@ typedef struct pg_atomic_uint64
  */
 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
 #define PG_HAVE_SPIN_DELAY
-static __inline__ void
+static inline void
 pg_spin_delay_impl(void)
 {
        __asm__ __volatile__(" rep; nop                 \n");
index 3d9070e79d4696a25e7021116f9441400814c47e..62364586d60b24297bc1a8d8c38c4ec18537f01d 100644 (file)
@@ -134,7 +134,7 @@ typedef unsigned char slock_t;
 
 #define TAS(lock) tas(lock)
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        slock_t         _res = 1;
@@ -164,7 +164,7 @@ tas(volatile slock_t *lock)
 
 #define SPIN_DELAY() spin_delay()
 
-static __inline__ void
+static inline void
 spin_delay(void)
 {
        /*
@@ -215,7 +215,7 @@ typedef unsigned char slock_t;
  */
 #define TAS_SPIN(lock)    (*(lock) ? 1 : TAS(lock))
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        slock_t         _res = 1;
@@ -231,7 +231,7 @@ tas(volatile slock_t *lock)
 
 #define SPIN_DELAY() spin_delay()
 
-static __inline__ void
+static inline void
 spin_delay(void)
 {
        /*
@@ -259,7 +259,7 @@ spin_delay(void)
 
 typedef int slock_t;
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        return __sync_lock_test_and_set(lock, 1);
@@ -277,7 +277,7 @@ tas(volatile slock_t *lock)
 
 #define SPIN_DELAY() spin_delay()
 
-static __inline__ void
+static inline void
 spin_delay(void)
 {
        /*
@@ -302,7 +302,7 @@ typedef unsigned int slock_t;
 
 #define TAS(lock)         tas(lock)
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        int                     _res = 0;
@@ -331,7 +331,7 @@ typedef unsigned char slock_t;
 
 #define TAS(lock) tas(lock)
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        slock_t         _res;
@@ -416,7 +416,7 @@ typedef unsigned int slock_t;
  * But if the spinlock is in ordinary memory, we can use lwsync instead for
  * better performance.
  */
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        slock_t _t;
@@ -482,7 +482,7 @@ typedef unsigned int slock_t;
 #define MIPS_SET_MIPS2
 #endif
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        volatile slock_t *_l = lock;
@@ -544,7 +544,7 @@ do \
 
 typedef int slock_t;
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        return __sync_lock_test_and_set(lock, 1);
@@ -559,7 +559,7 @@ tas(volatile slock_t *lock)
 
 typedef char slock_t;
 
-static __inline__ int
+static inline int
 tas(volatile slock_t *lock)
 {
        return __sync_lock_test_and_set(lock, 1);