summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-11-27 07:39:25 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-11-27 07:53:34 +0100
commite7075a3405cc831128a71e83b2e39d464aa67fe8 (patch)
treea1aaa46f172f5b36a63fcc2baf3ad3a5320a62ec /src
parent519fa0433b37701b357753a568080bee2c47d238 (diff)
Use C11 alignas in pg_atomic_uint64 definitions
They were already using pg_attribute_aligned. This replaces that with alignas and moves that into the required syntactic position. This ends up making these three atomics implementations appear a bit more consistent, but shouldn't change anything otherwise. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/46f05236-d4d4-4b4e-84d4-faa500f14691%40eisentraut.org
Diffstat (limited to 'src')
-rw-r--r--src/include/port/atomics/arch-ppc.h2
-rw-r--r--src/include/port/atomics/generic-gcc.h3
-rw-r--r--src/include/port/atomics/generic-msvc.h4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/include/port/atomics/arch-ppc.h b/src/include/port/atomics/arch-ppc.h
index b93f6766d29..2b3c3283469 100644
--- a/src/include/port/atomics/arch-ppc.h
+++ b/src/include/port/atomics/arch-ppc.h
@@ -36,7 +36,7 @@ typedef struct pg_atomic_uint32
#define PG_HAVE_ATOMIC_U64_SUPPORT
typedef struct pg_atomic_uint64
{
- volatile uint64 value pg_attribute_aligned(8);
+ alignas(8) volatile uint64 value;
} pg_atomic_uint64;
#endif
diff --git a/src/include/port/atomics/generic-gcc.h b/src/include/port/atomics/generic-gcc.h
index a0751f2286a..ee65647c53f 100644
--- a/src/include/port/atomics/generic-gcc.h
+++ b/src/include/port/atomics/generic-gcc.h
@@ -100,10 +100,9 @@ typedef struct pg_atomic_uint32
&& (defined(HAVE_GCC__ATOMIC_INT64_CAS) || defined(HAVE_GCC__SYNC_INT64_CAS))
#define PG_HAVE_ATOMIC_U64_SUPPORT
-
typedef struct pg_atomic_uint64
{
- volatile uint64 value pg_attribute_aligned(8);
+ alignas(8) volatile uint64 value;
} pg_atomic_uint64;
#endif /* defined(HAVE_GCC__ATOMIC_INT64_CAS) || defined(HAVE_GCC__SYNC_INT64_CAS) */
diff --git a/src/include/port/atomics/generic-msvc.h b/src/include/port/atomics/generic-msvc.h
index a6ea5f1c2e7..3d3c5363446 100644
--- a/src/include/port/atomics/generic-msvc.h
+++ b/src/include/port/atomics/generic-msvc.h
@@ -37,9 +37,9 @@ typedef struct pg_atomic_uint32
} pg_atomic_uint32;
#define PG_HAVE_ATOMIC_U64_SUPPORT
-typedef struct pg_attribute_aligned(8) pg_atomic_uint64
+typedef struct pg_atomic_uint64
{
- volatile uint64 value;
+ alignas(8) volatile uint64 value;
} pg_atomic_uint64;