Skip to content

Commit 50fbd09

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 87fbbd4 commit 50fbd09

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

955955
/* For debugging: display postmaster environment */
956956
{
957+
#if !defined(WIN32) || defined(_MSC_VER)
957958
extern char **environ;
959+
#endif
958960
char **p;
959961

960962
ereport(DEBUG3,

src/backend/utils/misc/ps_status.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#include "utils/guc.h"
2626
#include "utils/ps_status.h"
2727

28+
#if !defined(WIN32) || defined(_MSC_VER)
2829
extern char **environ;
30+
#endif
2931

3032
/* GUC variable */
3133
bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;

src/test/regress/regress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,9 @@ PG_FUNCTION_INFO_V1(get_environ);
650650
Datum
651651
get_environ(PG_FUNCTION_ARGS)
652652
{
653+
#if !defined(WIN32) || defined(_MSC_VER)
653654
extern char **environ;
655+
#endif
654656
int nvals = 0;
655657
ArrayType *result;
656658
Datum *env;

0 commit comments

Comments
 (0)