From 00afcc6891b29c7c91a4aec9e414773bbf9b2468 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 12 Nov 2025 11:55:29 +0100 Subject: [PATCH 3/4] Use C11 alignas in pg_atomic_uint64 definitions XXX This is just separate from the previous patch because it's harder to test. --- src/include/port/atomics/arch-ppc.h | 2 +- src/include/port/atomics/generic-gcc.h | 2 +- src/include/port/atomics/generic-msvc.h | 4 ++-- 3 files changed, 4 insertions(+), 4 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..18ea8787199 100644 --- a/src/include/port/atomics/generic-gcc.h +++ b/src/include/port/atomics/generic-gcc.h @@ -103,7 +103,7 @@ typedef struct pg_atomic_uint32 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; -- 2.51.0