diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-09-11 11:55:29 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-09-11 12:05:59 +0200 |
commit | 4fbe0151455fefbef7abc9d507adb04c978beb0d (patch) | |
tree | 5c010f9bb63623b1e751b5d3e7dda3e21154917e /src | |
parent | 368c38dd47c209fa95d2df855d62bcde386f3037 (diff) |
Remove checks for no longer supported GCC versions
Since commit f5e0186f865 (Raise C requirement to C11), we effectively
require at least GCC version 4.7, so checks for older versions can be
removed.
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/a0f817ee-fb86-483a-8a14-b6f7f5991b6e%40eisentraut.org
Diffstat (limited to 'src')
-rw-r--r-- | src/include/c.h | 8 | ||||
-rw-r--r-- | src/include/port/atomics/generic-gcc.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/include/c.h b/src/include/c.h index 39022f8a9dd..b580cfa7d31 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -259,8 +259,8 @@ * choose not to. But, if possible, don't force inlining in unoptimized * debug builds. */ -#if (defined(__GNUC__) && __GNUC__ > 3 && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) -/* GCC > 3 and Sunpro support always_inline via __attribute__ */ +#if (defined(__GNUC__) && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) +/* GCC and Sunpro support always_inline via __attribute__ */ #define pg_attribute_always_inline __attribute__((always_inline)) inline #elif defined(_MSC_VER) /* MSVC has a special keyword for this */ @@ -277,7 +277,7 @@ * above, this should be placed before the function's return type and name. */ /* GCC and Sunpro support noinline via __attribute__ */ -#if (defined(__GNUC__) && __GNUC__ > 2) || defined(__SUNPRO_C) +#if defined(__GNUC__) || defined(__SUNPRO_C) #define pg_noinline __attribute__((noinline)) /* msvc via declspec */ #elif defined(_MSC_VER) @@ -369,7 +369,7 @@ * These should only be used sparingly, in very hot code paths. It's very easy * to mis-estimate likelihoods. */ -#if __GNUC__ >= 3 +#ifdef __GNUC__ #define likely(x) __builtin_expect((x) != 0, 1) #define unlikely(x) __builtin_expect((x) != 0, 0) #else diff --git a/src/include/port/atomics/generic-gcc.h b/src/include/port/atomics/generic-gcc.h index d8f04c89cca..e7dfad4f0d5 100644 --- a/src/include/port/atomics/generic-gcc.h +++ b/src/include/port/atomics/generic-gcc.h @@ -30,14 +30,14 @@ #define pg_compiler_barrier_impl() __asm__ __volatile__("" ::: "memory") /* - * If we're on GCC 4.1.0 or higher, we should be able to get a memory barrier + * If we're on GCC, we should be able to get a memory barrier * out of this compiler built-in. But we prefer to rely on platform specific * definitions where possible, and use this only as a fallback. */ #if !defined(pg_memory_barrier_impl) # if defined(HAVE_GCC__ATOMIC_INT32_CAS) # define pg_memory_barrier_impl() __atomic_thread_fence(__ATOMIC_SEQ_CST) -# elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) +# elif defined(__GNUC__) # define pg_memory_barrier_impl() __sync_synchronize() # endif #endif /* !defined(pg_memory_barrier_impl) */ |