]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Backpatch: Fix warnings about declaration of environ on MinGW
authorAndres Freund <andres@anarazel.de>
Tue, 4 Nov 2025 18:24:59 +0000 (13:24 -0500)
committerAndres Freund <andres@anarazel.de>
Tue, 4 Nov 2025 18:24:59 +0000 (13:24 -0500)
Backpatch commit 7bc9a8bdd2d to 13-17. The motivation for backpatching is that
we want to update CI to Debian Trixie. Trixie contains a newer mingw
installation, which would trigger the warning addressed by 7bc9a8bdd2d. The
risk of backpatching seems fairly low, given that it did not cause issues in
the branches the commit is already present.

While CI is not present in 13-14, it seems better to be consistent across
branches.

Author: Thomas Munro <tmunro@postgresql.org>
Discussion: https://postgr.es/m/o5yadhhmyjo53svzwvaocww6zkrp63i4f32cw3treuh46pxtza@hyqio5b2tkt6
Backpatch-through: 13

src/backend/postmaster/postmaster.c
src/backend/utils/misc/ps_status.c
src/test/regress/regress.c

index 242b44eafc3d0af357a8faa614dbdc38d00dbd7e..fa7b7add93a0e2e58007ffc1e43ca0e3c40e43e8 100644 (file)
@@ -942,7 +942,9 @@ PostmasterMain(int argc, char *argv[])
 
        /* For debugging: display postmaster environment */
        {
+#if !defined(WIN32) || defined(_MSC_VER)
                extern char **environ;
+#endif
                char      **p;
 
                ereport(DEBUG3,
index 3a5c002d5de8a026867f11955edbd1e050d611ea..3b2317793520616e2d66fc727a84b8ed3da9e9e7 100644 (file)
@@ -32,7 +32,9 @@
 #include "utils/guc.h"
 #include "utils/ps_status.h"
 
+#if !defined(WIN32) || defined(_MSC_VER)
 extern char **environ;
+#endif
 bool           update_process_title = true;
 
 
index 481588c9a44cd94b07aa0ff7db2e0abdb188d8f9..ed75c410ffeb440efdc60bee14cea3e6bf8fcc4f 100644 (file)
@@ -631,7 +631,9 @@ PG_FUNCTION_INFO_V1(get_environ);
 Datum
 get_environ(PG_FUNCTION_ARGS)
 {
+#if !defined(WIN32) || defined(_MSC_VER)
        extern char **environ;
+#endif
        int                     nvals = 0;
        ArrayType  *result;
        Datum      *env;