From: Noah Misch <noah@leadboat.com>
Date: Sun, 3 Jul 2022 04:03:19 +0000 (-0700)
Subject: Fix previous commit's ecpg_clocale for ppc Darwin.
X-Git-Tag: REL_10_22~36
X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=f5e4d64bb3384a218bd8c89be6e041c59f1db270;p=postgresql.git

Fix previous commit's ecpg_clocale for ppc Darwin.

Per buildfarm member prairiedog, this platform rejects uninitialized
global variables in shared libraries.  Back-patch to v10, like the
addition of the variable.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20220703030619.GB2378460@rfd.leadboat.com
---

diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index b80d709b944..75cb30fc331 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -11,7 +11,7 @@
 #include "sqlca.h"
 
 #ifdef HAVE_USELOCALE
-locale_t	ecpg_clocale;
+locale_t	ecpg_clocale = (locale_t) 0;
 #endif
 
 #ifdef ENABLE_THREAD_SAFETY