aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/ecpglib')
-rw-r--r--src/interfaces/ecpg/ecpglib/descriptor.c4
-rw-r--r--src/interfaces/ecpg/ecpglib/ecpglib_extern.h2
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c6
3 files changed, 6 insertions, 6 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
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
index 41851d59007..ae2dcfc6172 100644
--- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
+++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
@@ -69,7 +69,7 @@ struct statement
locale_t oldlocale;
#else
char *oldlocale;
-#ifdef WIN32
+#ifdef HAVE__CONFIGTHREADLOCALE
int oldthreadlocale;
#endif
#endif
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 81aaf10f088..a9f945e6188 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -1778,7 +1778,7 @@ ecpg_do_prologue(int lineno, const int compat, const int force_indicator,
* Make sure we do NOT honor the locale for numeric input/output since the
* database wants the standard decimal point. If available, use
* uselocale() for this because it's thread-safe. Windows doesn't have
- * that, but it does have _configthreadlocale().
+ * that, but it usually does have _configthreadlocale().
*/
#ifdef HAVE_USELOCALE
stmt->clocale = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
@@ -1794,7 +1794,7 @@ ecpg_do_prologue(int lineno, const int compat, const int force_indicator,
return false;
}
#else
-#ifdef WIN32
+#ifdef HAVE__CONFIGTHREADLOCALE
stmt->oldthreadlocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
if (stmt->oldthreadlocale == -1)
{
@@ -2019,7 +2019,7 @@ ecpg_do_epilogue(struct statement *stmt)
if (stmt->oldlocale)
{
setlocale(LC_NUMERIC, stmt->oldlocale);
-#ifdef WIN32
+#ifdef HAVE__CONFIGTHREADLOCALE
_configthreadlocale(stmt->oldthreadlocale);
#endif
}