1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add fallback implementation for setenv()

This fixes the code compilation on Windows with MSVC and Kerberos, as
a missing implementation of setenv() causes a compilation failure of the
GSSAPI code.  This was only reproducible when building the code with
Kerberos, something that buildfarm animal hamerkop has fixed recently.

This issue only happens on 12 and 13, as this code has been introduced
in b0b39f7.  HEAD is already able to compile properly thanks to
7ca37fb0, and this commit is a minimal cherry-pick of it.

Thanks to Tom Lane for the discussion.

Discussion: https://postgr.es/m/YLDtm5WGjPxm6ua4@paquier.xyz
Backpatch-through: 12
This commit is contained in:
Michael Paquier
2021-06-01 09:27:31 +09:00
parent 6f9e7f21fd
commit 02037af3ff
8 changed files with 82 additions and 3 deletions

View File

@ -1788,12 +1788,14 @@ case $host_os in
# and doesn't need a replacement getpeereid because it doesn't use
# Unix sockets.
mingw*)
AC_DEFINE(HAVE_SETENV, 1, [Define to 1 because replacement version used.])
AC_DEFINE(HAVE_UNSETENV, 1, [Define to 1 because replacement version used.])
AC_DEFINE(HAVE_GETPEEREID, 1, [Define to 1 because function not required.])
ac_cv_func_setenv=yes
ac_cv_func_unsetenv=yes
ac_cv_func_getpeereid=yes;;
*)
AC_REPLACE_FUNCS([unsetenv getpeereid])
AC_REPLACE_FUNCS([setenv unsetenv getpeereid])
;;
esac