diff options
| author | Andres Freund <andres@anarazel.de> | 2015-08-05 18:19:52 +0200 |
|---|---|---|
| committer | Andres Freund <andres@anarazel.de> | 2015-08-05 18:19:52 +0200 |
| commit | de6fd1c898f6eca82c2130a9dbb42d00da68d79e (patch) | |
| tree | 2387db94ee7d19f19ec45dbfc31c3a6c3494a62c /src/include/port | |
| parent | a855118be3f0682a2061448db5a87dec50717af4 (diff) | |
| download | postgresql-de6fd1c898f6eca82c2130a9dbb42d00da68d79e.tar.gz | |
Rely on inline functions even if that causes warnings in older compilers.
So far we have worked around the fact that some very old compilers do
not support 'inline' functions by only using inline functions
conditionally (or not at all). Since such compilers are very rare by
now, we have decided to rely on inline functions from 9.6 onwards.
To avoid breaking these old compilers inline is defined away when not
supported. That'll cause "function x defined but not used" type of
warnings, but since nobody develops on such compilers anymore that's
ok.
This change in policy will allow us to more easily employ inline
functions.
I chose to remove code previously conditional on PG_USE_INLINE as it
seemed confusing to have code dependent on a define that's always
defined.
Blacklisting of compilers, like in c53f73879f, now has to be done
differently. A platform template can define PG_FORCE_DISABLE_INLINE to
force inline to be defined empty.
Discussion: 20150701161447.GB30708@awork2.anarazel.de
Diffstat (limited to 'src/include/port')
| -rw-r--r-- | src/include/port/atomics.h | 101 | ||||
| -rw-r--r-- | src/include/port/atomics/arch-x86.h | 4 | ||||
| -rw-r--r-- | src/include/port/atomics/fallback.h | 5 | ||||
| -rw-r--r-- | src/include/port/atomics/generic-acc.h | 12 | ||||
| -rw-r--r-- | src/include/port/atomics/generic-gcc.h | 8 | ||||
| -rw-r--r-- | src/include/port/atomics/generic-msvc.h | 8 | ||||
| -rw-r--r-- | src/include/port/atomics/generic-sunpro.h | 4 | ||||
| -rw-r--r-- | src/include/port/atomics/generic-xlc.h | 8 | ||||
| -rw-r--r-- | src/include/port/atomics/generic.h | 4 |
9 files changed, 29 insertions, 125 deletions
diff --git a/src/include/port/atomics.h b/src/include/port/atomics.h index d94fea60f1..bb87945088 100644 --- a/src/include/port/atomics.h +++ b/src/include/port/atomics.h @@ -118,46 +118,6 @@ */ #include "port/atomics/generic.h" -/* - * Provide declarations for all functions here - on most platforms static - * inlines are used and these aren't necessary, but when static inline is - * unsupported these will be external functions. - */ -STATIC_IF_INLINE_DECLARE void pg_atomic_init_flag(volatile pg_atomic_flag *ptr); -STATIC_IF_INLINE_DECLARE bool pg_atomic_test_set_flag(volatile pg_atomic_flag *ptr); -STATIC_IF_INLINE_DECLARE bool pg_atomic_unlocked_test_flag(volatile pg_atomic_flag *ptr); -STATIC_IF_INLINE_DECLARE void pg_atomic_clear_flag(volatile pg_atomic_flag *ptr); - -STATIC_IF_INLINE_DECLARE void pg_atomic_init_u32(volatile pg_atomic_uint32 *ptr, uint32 val); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr); -STATIC_IF_INLINE_DECLARE void pg_atomic_write_u32(volatile pg_atomic_uint32 *ptr, uint32 val); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_exchange_u32(volatile pg_atomic_uint32 *ptr, uint32 newval); -STATIC_IF_INLINE_DECLARE bool pg_atomic_compare_exchange_u32(volatile pg_atomic_uint32 *ptr, - uint32 *expected, uint32 newval); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_fetch_add_u32(volatile pg_atomic_uint32 *ptr, int32 add_); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_fetch_sub_u32(volatile pg_atomic_uint32 *ptr, int32 sub_); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_fetch_and_u32(volatile pg_atomic_uint32 *ptr, uint32 and_); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_fetch_or_u32(volatile pg_atomic_uint32 *ptr, uint32 or_); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_add_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 add_); -STATIC_IF_INLINE_DECLARE uint32 pg_atomic_sub_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 sub_); - -#ifdef PG_HAVE_ATOMIC_U64_SUPPORT - -STATIC_IF_INLINE_DECLARE void pg_atomic_init_u64(volatile pg_atomic_uint64 *ptr, uint64 val_); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_read_u64(volatile pg_atomic_uint64 *ptr); -STATIC_IF_INLINE_DECLARE void pg_atomic_write_u64(volatile pg_atomic_uint64 *ptr, uint64 val); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_exchange_u64(volatile pg_atomic_uint64 *ptr, uint64 newval); -STATIC_IF_INLINE_DECLARE bool pg_atomic_compare_exchange_u64(volatile pg_atomic_uint64 *ptr, - uint64 *expected, uint64 newval); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_fetch_add_u64(volatile pg_atomic_uint64 *ptr, int64 add_); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_fetch_sub_u64(volatile pg_atomic_uint64 *ptr, int64 sub_); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_fetch_and_u64(volatile pg_atomic_uint64 *ptr, uint64 and_); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_fetch_or_u64(volatile pg_atomic_uint64 *ptr, uint64 or_); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_add_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 add_); -STATIC_IF_INLINE_DECLARE uint64 pg_atomic_sub_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 sub_); - -#endif /* PG_HAVE_64_BIT_ATOMICS */ - /* * pg_compiler_barrier - prevent the compiler from moving code across @@ -202,17 +162,11 @@ STATIC_IF_INLINE_DECLARE uint64 pg_atomic_sub_fetch_u64(volatile pg_atomic_uint6 #define pg_spin_delay() pg_spin_delay_impl() /* - * The following functions are wrapper functions around the platform specific - * implementation of the atomic operations performing common checks. - */ -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - -/* * pg_atomic_init_flag - initialize atomic flag. * * No barrier semantics. */ -STATIC_IF_INLINE_DECLARE void +static inline void pg_atomic_init_flag(volatile pg_atomic_flag *ptr) { AssertPointerAlignment(ptr, sizeof(*ptr)); @@ -227,7 +181,7 @@ pg_atomic_init_flag(volatile pg_atomic_flag *ptr) * * Acquire (including read barrier) semantics. */ -STATIC_IF_INLINE_DECLARE bool +static inline bool pg_atomic_test_set_flag(volatile pg_atomic_flag *ptr) { AssertPointerAlignment(ptr, sizeof(*ptr)); @@ -242,7 +196,7 @@ pg_atomic_test_set_flag(volatile pg_atomic_flag *ptr) * * No barrier semantics. */ -STATIC_IF_INLINE_DECLARE bool +static inline bool pg_atomic_unlocked_test_flag(volatile pg_atomic_flag *ptr) { AssertPointerAlignment(ptr, sizeof(*ptr)); @@ -255,7 +209,7 @@ pg_atomic_unlocked_test_flag(volatile pg_atomic_flag *ptr) * * Release (including write barrier) semantics. */ -STATIC_IF_INLINE_DECLARE void +static inline void pg_atomic_clear_flag(volatile pg_atomic_flag *ptr) { AssertPointerAlignment(ptr, sizeof(*ptr)); @@ -271,7 +225,7 @@ pg_atomic_clear_flag(volatile pg_atomic_flag *ptr) * * No barrier semantics. */ -STATIC_IF_INLINE_DECLARE void +static inline void pg_atomic_init_u32(volatile pg_atomic_uint32 *ptr, uint32 val) { AssertPointerAlignment(ptr, 4); @@ -289,7 +243,7 @@ pg_atomic_init_u32(volatile pg_atomic_uint32 *ptr, uint32 val) * * No barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr) { AssertPointerAlignment(ptr, 4); @@ -304,7 +258,7 @@ pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr) * * No barrier semantics. */ -STATIC_IF_INLINE_DECLARE void +static inline void pg_atomic_write_u32(volatile pg_atomic_uint32 *ptr, uint32 val) { AssertPointerAlignment(ptr, 4); @@ -319,7 +273,7 @@ pg_atomic_write_u32(volatile pg_atomic_uint32 *ptr, uint32 val) * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_exchange_u32(volatile pg_atomic_uint32 *ptr, uint32 newval) { AssertPointerAlignment(ptr, 4); @@ -338,7 +292,7 @@ pg_atomic_exchange_u32(volatile pg_atomic_uint32 *ptr, uint32 newval) * * Full barrier semantics. */ -STATIC_IF_INLINE bool +static inline bool pg_atomic_compare_exchange_u32(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { @@ -355,7 +309,7 @@ pg_atomic_compare_exchange_u32(volatile pg_atomic_uint32 *ptr, * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_fetch_add_u32(volatile pg_atomic_uint32 *ptr, int32 add_) { AssertPointerAlignment(ptr, 4); @@ -370,7 +324,7 @@ pg_atomic_fetch_add_u32(volatile pg_atomic_uint32 *ptr, int32 add_) * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_fetch_sub_u32(volatile pg_atomic_uint32 *ptr, int32 sub_) { AssertPointerAlignment(ptr, 4); @@ -385,7 +339,7 @@ pg_atomic_fetch_sub_u32(volatile pg_atomic_uint32 *ptr, int32 sub_) * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_fetch_and_u32(volatile pg_atomic_uint32 *ptr, uint32 and_) { AssertPointerAlignment(ptr, 4); @@ -399,7 +353,7 @@ pg_atomic_fetch_and_u32(volatile pg_atomic_uint32 *ptr, uint32 and_) * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_fetch_or_u32(volatile pg_atomic_uint32 *ptr, uint32 or_) { AssertPointerAlignment(ptr, 4); @@ -413,7 +367,7 @@ pg_atomic_fetch_or_u32(volatile pg_atomic_uint32 *ptr, uint32 or_) * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_add_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 add_) { AssertPointerAlignment(ptr, 4); @@ -428,7 +382,7 @@ pg_atomic_add_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 add_) * * Full barrier semantics. */ -STATIC_IF_INLINE uint32 +static inline uint32 pg_atomic_sub_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 sub_) { AssertPointerAlignment(ptr, 4); @@ -444,7 +398,7 @@ pg_atomic_sub_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 sub_) */ #ifdef PG_HAVE_ATOMIC_U64_SUPPORT -STATIC_IF_INLINE_DECLARE void +static inline void pg_atomic_init_u64(volatile pg_atomic_uint64 *ptr, uint64 val) { AssertPointerAlignment(ptr, 8); @@ -452,21 +406,21 @@ pg_atomic_init_u64(volatile pg_atomic_uint64 *ptr, uint64 val) pg_atomic_init_u64_impl(ptr, val); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_read_u64(volatile pg_atomic_uint64 *ptr) { AssertPointerAlignment(ptr, 8); return pg_atomic_read_u64_impl(ptr); } -STATIC_IF_INLINE void +static inline void pg_atomic_write_u64(volatile pg_atomic_uint64 *ptr, uint64 val) { AssertPointerAlignment(ptr, 8); pg_atomic_write_u64_impl(ptr, val); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_exchange_u64(volatile pg_atomic_uint64 *ptr, uint64 newval) { AssertPointerAlignment(ptr, 8); @@ -474,7 +428,7 @@ pg_atomic_exchange_u64(volatile pg_atomic_uint64 *ptr, uint64 newval) return pg_atomic_exchange_u64_impl(ptr, newval); } -STATIC_IF_INLINE bool +static inline bool pg_atomic_compare_exchange_u64(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval) { @@ -483,14 +437,14 @@ pg_atomic_compare_exchange_u64(volatile pg_atomic_uint64 *ptr, return pg_atomic_compare_exchange_u64_impl(ptr, expected, newval); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_fetch_add_u64(volatile pg_atomic_uint64 *ptr, int64 add_) { AssertPointerAlignment(ptr, 8); return pg_atomic_fetch_add_u64_impl(ptr, add_); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_fetch_sub_u64(volatile pg_atomic_uint64 *ptr, int64 sub_) { AssertPointerAlignment(ptr, 8); @@ -498,28 +452,28 @@ pg_atomic_fetch_sub_u64(volatile pg_atomic_uint64 *ptr, int64 sub_) return pg_atomic_fetch_sub_u64_impl(ptr, sub_); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_fetch_and_u64(volatile pg_atomic_uint64 *ptr, uint64 and_) { AssertPointerAlignment(ptr, 8); return pg_atomic_fetch_and_u64_impl(ptr, and_); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_fetch_or_u64(volatile pg_atomic_uint64 *ptr, uint64 or_) { AssertPointerAlignment(ptr, 8); return pg_atomic_fetch_or_u64_impl(ptr, or_); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_add_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 add_) { AssertPointerAlignment(ptr, 8); return pg_atomic_add_fetch_u64_impl(ptr, add_); } -STATIC_IF_INLINE uint64 +static inline uint64 pg_atomic_sub_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 sub_) { AssertPointerAlignment(ptr, 8); @@ -529,9 +483,6 @@ pg_atomic_sub_fetch_u64(volatile pg_atomic_uint64 *ptr, int64 sub_) #endif /* PG_HAVE_64_BIT_ATOMICS */ -#endif /* defined(PG_USE_INLINE) || - * defined(ATOMICS_INCLUDE_DEFINITIONS) */ - #undef INSIDE_ATOMICS_H #endif /* ATOMICS_H */ diff --git a/src/include/port/atomics/arch-x86.h b/src/include/port/atomics/arch-x86.h index 168a49c793..3f65accae8 100644 --- a/src/include/port/atomics/arch-x86.h +++ b/src/include/port/atomics/arch-x86.h @@ -82,8 +82,6 @@ typedef struct pg_atomic_uint64 #endif /* defined(__GNUC__) && !defined(__INTEL_COMPILER) */ -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - #if !defined(PG_HAVE_SPIN_DELAY) /* * This sequence is equivalent to the PAUSE instruction ("rep" is @@ -251,5 +249,3 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) #endif /* defined(__GNUC__) && !defined(__INTEL_COMPILER) */ #endif /* HAVE_ATOMICS */ - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ diff --git a/src/include/port/atomics/fallback.h b/src/include/port/atomics/fallback.h index 4e04f9758b..df8ae56b30 100644 --- a/src/include/port/atomics/fallback.h +++ b/src/include/port/atomics/fallback.h @@ -102,8 +102,6 @@ typedef struct pg_atomic_uint32 #endif /* PG_HAVE_ATOMIC_U32_SUPPORT */ -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - #ifdef PG_HAVE_ATOMIC_FLAG_SIMULATION #define PG_HAVE_ATOMIC_INIT_FLAG @@ -143,6 +141,3 @@ extern bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, extern uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_); #endif /* PG_HAVE_ATOMIC_U32_SIMULATION */ - - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ diff --git a/src/include/port/atomics/generic-acc.h b/src/include/port/atomics/generic-acc.h index c5639aadda..c224691782 100644 --- a/src/include/port/atomics/generic-acc.h +++ b/src/include/port/atomics/generic-acc.h @@ -49,18 +49,12 @@ typedef struct pg_atomic_uint64 volatile uint64 value; } pg_atomic_uint64; -#endif /* defined(HAVE_ATOMICS) */ - - -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - -#if defined(HAVE_ATOMICS) #define MINOR_FENCE (_Asm_fence) (_UP_CALL_FENCE | _UP_SYS_FENCE | \ _DOWN_CALL_FENCE | _DOWN_SYS_FENCE ) #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 -STATIC_IF_INLINE bool +static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { @@ -88,7 +82,7 @@ pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 -STATIC_IF_INLINE bool +static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval) { @@ -110,5 +104,3 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, #undef MINOR_FENCE #endif /* defined(HAVE_ATOMICS) */ - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ diff --git a/src/include/port/atomics/generic-gcc.h b/src/include/port/atomics/generic-gcc.h index 591c9fe1eb..306c38f6f7 100644 --- a/src/include/port/atomics/generic-gcc.h +++ b/src/include/port/atomics/generic-gcc.h @@ -57,6 +57,7 @@ # define pg_write_barrier_impl() __atomic_thread_fence(__ATOMIC_RELEASE) #endif + #ifdef HAVE_ATOMICS /* generic gcc based atomic flag implementation */ @@ -103,11 +104,6 @@ typedef struct pg_atomic_uint64 #endif /* defined(HAVE_GCC__ATOMIC_INT64_CAS) || defined(HAVE_GCC__SYNC_INT64_CAS) */ -/* - * Implementation follows. Inlined or directly included from atomics.c - */ -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - #ifdef PG_HAVE_ATOMIC_FLAG_SUPPORT #if defined(HAVE_GCC__SYNC_CHAR_TAS) || defined(HAVE_GCC__SYNC_INT32_TAS) @@ -231,6 +227,4 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) #endif /* !defined(PG_DISABLE_64_BIT_ATOMICS) */ -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ - #endif /* defined(HAVE_ATOMICS) */ diff --git a/src/include/port/atomics/generic-msvc.h b/src/include/port/atomics/generic-msvc.h index d259d6f51d..436baefb5d 100644 --- a/src/include/port/atomics/generic-msvc.h +++ b/src/include/port/atomics/generic-msvc.h @@ -46,12 +46,6 @@ typedef struct __declspec(align(8)) pg_atomic_uint64 volatile uint64 value; } pg_atomic_uint64; -#endif /* defined(HAVE_ATOMICS) */ - - -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - -#if defined(HAVE_ATOMICS) #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 static inline bool @@ -107,5 +101,3 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) #endif /* _WIN64 */ #endif /* HAVE_ATOMICS */ - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ diff --git a/src/include/port/atomics/generic-sunpro.h b/src/include/port/atomics/generic-sunpro.h index d369207fb3..867fab71c7 100644 --- a/src/include/port/atomics/generic-sunpro.h +++ b/src/include/port/atomics/generic-sunpro.h @@ -69,8 +69,6 @@ typedef struct pg_atomic_uint64 #endif /* defined(HAVE_ATOMICS) */ -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - #if defined(HAVE_ATOMICS) #ifdef HAVE_ATOMIC_H @@ -106,5 +104,3 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, #endif /* HAVE_ATOMIC_H */ #endif /* defined(HAVE_ATOMICS) */ - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ diff --git a/src/include/port/atomics/generic-xlc.h b/src/include/port/atomics/generic-xlc.h index 0ad9168ed2..4e26f88d70 100644 --- a/src/include/port/atomics/generic-xlc.h +++ b/src/include/port/atomics/generic-xlc.h @@ -35,12 +35,6 @@ typedef struct pg_atomic_uint64 #endif /* __64BIT__ */ -#endif /* defined(HAVE_ATOMICS) */ - -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - -#if defined(HAVE_ATOMICS) - #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, @@ -91,5 +85,3 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) #endif /* PG_HAVE_ATOMIC_U64_SUPPORT */ #endif /* defined(HAVE_ATOMICS) */ - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ diff --git a/src/include/port/atomics/generic.h b/src/include/port/atomics/generic.h index bb31df3623..56a7c286af 100644 --- a/src/include/port/atomics/generic.h +++ b/src/include/port/atomics/generic.h @@ -40,8 +40,6 @@ typedef pg_atomic_uint32 pg_atomic_flag; #endif -#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) - #ifndef PG_HAVE_ATOMIC_READ_U32 #define PG_HAVE_ATOMIC_READ_U32 static inline uint32 @@ -383,5 +381,3 @@ pg_atomic_sub_fetch_u64_impl(volatile pg_atomic_uint64 *ptr, int64 sub_) #endif #endif /* PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 */ - -#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */ |
