Skip to content

Commit d7aeb03

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 9c742c3 commit d7aeb03

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

943943
/* For debugging: display postmaster environment */
944944
{
945+
#if !defined(WIN32) || defined(_MSC_VER)
945946
extern char **environ;
947+
#endif
946948
char **p;
947949

948950
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
@@ -631,7 +631,9 @@ PG_FUNCTION_INFO_V1(get_environ);
631631
Datum
632632
get_environ(PG_FUNCTION_ARGS)
633633
{
634+
#if !defined(WIN32) || defined(_MSC_VER)
634635
extern char **environ;
636+
#endif
635637
int nvals = 0;
636638
ArrayType *result;
637639
Datum *env;

0 commit comments

Comments
 (0)