From b2c1546aea10bbfc436e6d2a986094e4bd9fa0e8 Mon Sep 17 00:00:00 2001
From: Junwang Zhao <zhjwpku@gmail.com>
Date: Fri, 14 Oct 2022 10:49:46 +0800
Subject: [PATCH v1] [meson] add missing pg_attribute_aligned for MSVC

Commit ec3c9cc add pg_attribute_aligned in MSVC[1],
which was pushed one day before the meson commits,
so meson build missed this feature.

[1]: https://www.postgresql.org/message-id/CAAaqYe-HbtZvR3msoMtk+hYW2S0e0OapzMW8icSMYTMA+mN8Aw@mail.gmail.com

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meson.build b/meson.build
index 925db70c9d..2cbe60f6d9 100644
--- a/meson.build
+++ b/meson.build
@@ -1458,6 +1458,8 @@ if cc.links('''
     /* This must match the corresponding code in c.h: */
     #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
     #define pg_attribute_aligned(a) __attribute__((aligned(a)))
+    #elif defined(_MSC_VER)
+    #define pg_attribute_aligned(a) __declspec(align(a))
     #endif
     typedef __int128 int128a
     #if defined(pg_attribute_aligned)
-- 
2.33.0

