Skip to content

Commit 00bdbac

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 42fa4db commit 00bdbac

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
@@ -972,7 +972,9 @@ PostmasterMain(int argc, char *argv[])
972972

973973
/* For debugging: display postmaster environment */
974974
{
975+
#if !defined(WIN32) || defined(_MSC_VER)
975976
extern char **environ;
977+
#endif
976978
char **p;
977979

978980
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
@@ -644,7 +644,9 @@ PG_FUNCTION_INFO_V1(get_environ);
644644
Datum
645645
get_environ(PG_FUNCTION_ARGS)
646646
{
647+
#if !defined(WIN32) || defined(_MSC_VER)
647648
extern char **environ;
649+
#endif
648650
int nvals = 0;
649651
ArrayType *result;
650652
Datum *env;

0 commit comments

Comments
 (0)