Hi,

On 2022-10-14 10:59:28 +0800, Junwang Zhao wrote:
> Commit ec3c9cc add pg_attribute_aligned in MSVC[1],
> which was pushed one day before the meson commits,
> so meson build missed this feature.

Good catch. It shouldn't have practical consequences for the moment, given
that msvc doesn't support 128bit integers, but of course we should still be
correct.

Looked through other recent changes to configure and found a few additional
omissions.

See the attached patch fixing those omissions. I'll push it to HEAD once it
has the CI stamp of approval.

Greetings,

Andres Freund
>From 57bab33302d4cdd8d48f91382aac912d7f07de59 Mon Sep 17 00:00:00 2001
From: Andres Freund <and...@anarazel.de>
Date: Sat, 15 Oct 2022 12:00:16 -0700
Subject: [PATCH v1] meson: catch up to a few configure changes

I (Andres) missed a few recent changes to configure when merging
e6927270cd1 "meson: Add initial version of meson based build system". Mirror
the changes in
- ec3c9cc202f "Add definition pg_attribute_aligned() for MSVC"
- b086a47a270 "Bump minimum version of Bison to 2.3"
- 8b878bffa8d "Bump minimum version of Flex to 2.5.35"

As MSVC does not implement 128 bit integers, the oversight of not using
pg_attribute_aligned() should not have current practical consequences. But of
course the code from c.h should still be correctly mirrored.

I (Andres) also hadn't implemented the minimum perl version check. Added that
now.

Reported-by: Junwang Zhao <zhjw...@gmail.com>
Author: Junwang Zhao <zhjw...@gmail.com>
Author: Andres Freund <and...@anarazel.de>
Discussion: https://postgr.es/m/caeg8a3k9c87ewawmdogms0li1j6p_7r-uc0-zn6cjtrmr7v...@mail.gmail.com
---
 meson.build | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 925db70c9d5..fdf8ec8ad9c 100644
--- a/meson.build
+++ b/meson.build
@@ -316,8 +316,8 @@ endif
 # External programs
 perl = find_program(get_option('PERL'), required: true, native: true)
 python = find_program(get_option('PYTHON'), required: true, native: true)
-flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.31')
-bison = find_program(get_option('BISON'), native: true, version: '>= 1.875')
+flex = find_program(get_option('FLEX'), native: true, version: '>= 2.5.35')
+bison = find_program(get_option('BISON'), native: true, version: '>= 2.3')
 sed = find_program(get_option('SED'), 'sed', native: true)
 prove = find_program(get_option('PROVE'), native: true)
 tar = find_program(get_option('TAR'), native: true)
@@ -864,7 +864,10 @@ if not perlopt.disabled()
 
     perl_inc_dir = '@0@/CORE'.format(archlibexp)
 
-    if useshrplib != 'true'
+    if perlversion.version_compare('< 5.14')
+      perl_may_work = false
+      perl_msg = 'Perl version 5.14 or later is required, but this is @0@'.format(perlversion)
+    elif useshrplib != 'true'
       perl_may_work = false
       perl_msg = 'need a shared perl'
     endif
@@ -1458,6 +1461,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.38.0

Reply via email to