diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-01-21 16:17:10 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-01-21 16:17:10 -0500 |
commit | ee27584c4a40620fb26d1729e9cc449d54d62b07 (patch) | |
tree | e841f04f0e7ca473503f6dc52b1bf53a3c8c2f4b /src/interfaces/ecpg/ecpglib/descriptor.c | |
parent | 527114e51e45dbd91d46171fa4a111355f0dfc3b (diff) |
Second try at fixing ecpglib thread-safety problem.
While Windows (allegedly) has _configthreadlocale() pretty far back,
it seems MinGW didn't acquire support for that till more recently.
Fortunately, we can use an autoconf probe on that toolchain,
instead of guessing whether it's there. (Hm, I wonder whether Cygwin
will need this also.)
Per buildfarm.
Discussion: https://postgr.es/m/20190121193512.tdmcnic2yjxlufaw@alap3.anarazel.de
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/descriptor.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/descriptor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c index 71cef151724..aeb33636607 100644 --- a/src/interfaces/ecpg/ecpglib/descriptor.c +++ b/src/interfaces/ecpg/ecpglib/descriptor.c @@ -495,7 +495,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) if (stmt.clocale != (locale_t) 0) stmt.oldlocale = uselocale(stmt.clocale); #else -#ifdef WIN32 +#ifdef HAVE__CONFIGTHREADLOCALE stmt.oldthreadlocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); #endif stmt.oldlocale = ecpg_strdup(setlocale(LC_NUMERIC, NULL), lineno); @@ -517,7 +517,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) setlocale(LC_NUMERIC, stmt.oldlocale); ecpg_free(stmt.oldlocale); } -#ifdef WIN32 +#ifdef HAVE__CONFIGTHREADLOCALE if (stmt.oldthreadlocale != -1) _configthreadlocale(stmt.oldthreadlocale); #endif |