Bogus HAVE_DECL_FOO entries in msvc/Solution.pm - Mailing list pgsql-hackers

From Tom Lane
Subject Bogus HAVE_DECL_FOO entries in msvc/Solution.pm
Date
Msg-id 3185430.1626133592@sss.pgh.pa.us
Whole thread Raw
Responses Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm  (Michael Paquier <michael@paquier.xyz>)
Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
Autoconf's AC_CHECK_DECLS always defines HAVE_DECL_whatever
as 1 or 0, but some of the entries in msvc/Solution.pm show
such symbols as "undef" instead.  Shouldn't we fix it as
per attached?  This is probably only cosmetic at the moment,
but it could bite us someday if someone wrote a complex
conditional using one of these symbols.

These apparently-bogus values date to Peter's 8f4fb4c64,
which created that table; but AFAICS it was just faithfully
emulating the previous confused state of affairs.

            regards, tom lane

diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 294b968dcd..cfda5ac185 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -239,18 +239,18 @@ sub GenerateFiles
         HAVE_CRYPTO_LOCK           => undef,
         HAVE_DECL_FDATASYNC        => 0,
         HAVE_DECL_F_FULLFSYNC      => 0,
-        HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER => undef,
-        HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER    => undef,
+        HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER => 0,
+        HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER    => 0,
         HAVE_DECL_LLVMGETHOSTCPUNAME                => 0,
         HAVE_DECL_LLVMGETHOSTCPUFEATURES            => 0,
         HAVE_DECL_LLVMORCGETSYMBOLADDRESSIN         => 0,
-        HAVE_DECL_POSIX_FADVISE                     => undef,
+        HAVE_DECL_POSIX_FADVISE                     => 0,
         HAVE_DECL_PREADV                            => 0,
         HAVE_DECL_PWRITEV                           => 0,
         HAVE_DECL_RTLD_GLOBAL                       => 0,
         HAVE_DECL_RTLD_NOW                          => 0,
-        HAVE_DECL_STRLCAT                           => undef,
-        HAVE_DECL_STRLCPY                           => undef,
+        HAVE_DECL_STRLCAT                           => 0,
+        HAVE_DECL_STRLCPY                           => 0,
         HAVE_DECL_STRNLEN                           => 1,
         HAVE_DECL_STRTOLL                           => 1,
         HAVE_DECL_STRTOULL                          => 1,

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: possibility to read dumped table's name from file
Next
From: Thomas Munro
Date:
Subject: Re: proposal - psql - use pager for \watch command