Skip to content

Commit 371d40c

Browse files
committed
Backpatch: Fix warnings about declaration of environ on MinGW
Backpatch commit 7bc9a8b 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 7bc9a8b. 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
1 parent 2c56b70 commit 371d40c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,9 @@ PostmasterMain(int argc, char *argv[])
947947

948948
/* For debugging: display postmaster environment */
949949
{
950+
#if !defined(WIN32) || defined(_MSC_VER)
950951
extern char **environ;
952+
#endif
951953
char **p;
952954

953955
ereport(DEBUG3,

src/backend/utils/misc/ps_status.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
#include "utils/guc.h"
3333
#include "utils/ps_status.h"
3434

35+
#if !defined(WIN32) || defined(_MSC_VER)
3536
extern char **environ;
37+
#endif
3638
bool update_process_title = true;
3739

3840

src/test/regress/regress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,9 @@ PG_FUNCTION_INFO_V1(get_environ);
634634
Datum
635635
get_environ(PG_FUNCTION_ARGS)
636636
{
637+
#if !defined(WIN32) || defined(_MSC_VER)
637638
extern char **environ;
639+
#endif
638640
int nvals = 0;
639641
ArrayType *result;
640642
Datum *env;

0 commit comments

Comments
 (0)