diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-09-21 10:11:23 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-09-21 10:11:23 +0900 |
commit | ec3c9cc202fb2749fce82483e6dc247cfe286cab (patch) | |
tree | 3de8933a2bdeb4af9950c26844efde71b0588949 /src/include/port/atomics/generic-msvc.h | |
parent | 1c27d16e6e5c1f463bbe1e9ece88dda811235165 (diff) |
Add definition pg_attribute_aligned() for MSVC
Visual Studio 2015+ has support for a macro to control the alignement of
structures as of __declspec(align(#)), and this commit adds a definition
of pg_attribute_aligned() based on that. It happens that this was
already used in the implementation of atomics for MSVC. Note that there
is still no definition fo pg_attribute_packed(), so this does not impact
itemptr.h.
Author: James Coleman
Discussion: https://postgr.es/m/CAAaqYe-HbtZvR3msoMtk+hYW2S0e0OapzMW8icSMYTMA+mN8Aw@mail.gmail.com
Diffstat (limited to 'src/include/port/atomics/generic-msvc.h')
-rw-r--r-- | src/include/port/atomics/generic-msvc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/port/atomics/generic-msvc.h b/src/include/port/atomics/generic-msvc.h index 1a4adfde686..f3091b97318 100644 --- a/src/include/port/atomics/generic-msvc.h +++ b/src/include/port/atomics/generic-msvc.h @@ -39,7 +39,7 @@ typedef struct pg_atomic_uint32 } pg_atomic_uint32; #define PG_HAVE_ATOMIC_U64_SUPPORT -typedef struct __declspec(align(8)) pg_atomic_uint64 +typedef struct pg_attribute_aligned(8) pg_atomic_uint64 { volatile uint64 value; } pg_atomic_uint64; |