aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test/thread/thread_implicit.pgc
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2017-08-26 19:07:25 +0200
committerMichael Meskes <meskes@postgresql.org>2017-08-26 19:11:58 +0200
commit04fbe0e4516d26de9420637f6fc90041e574b4b0 (patch)
tree7dccba7848729d1176b6b35e687ebd8884e9660e /src/interfaces/ecpg/test/thread/thread_implicit.pgc
parent2073c641b43e1310784dc40aef32f71119313bdc (diff)
downloadpostgresql-04fbe0e4516d26de9420637f6fc90041e574b4b0.tar.gz
postgresql-04fbe0e4516d26de9420637f6fc90041e574b4b0.zip
Changed order of statements and added an additiona MSVC safeguard to make ecpg
thread test cases work on Windows.
Diffstat (limited to 'src/interfaces/ecpg/test/thread/thread_implicit.pgc')
-rw-r--r--src/interfaces/ecpg/test/thread/thread_implicit.pgc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/test/thread/thread_implicit.pgc b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
index aab758ed92c..d65f17c0736 100644
--- a/src/interfaces/ecpg/test/thread/thread_implicit.pgc
+++ b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
@@ -100,15 +100,17 @@ void *test_thread(void *arg)
{
long threadnum = (long)arg;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
EXEC SQL BEGIN DECLARE SECTION;
int l_i;
char l_connection[128];
EXEC SQL END DECLARE SECTION;
+#ifdef WIN32
+#ifdef _MSC_VER /* requires MSVC */
+ _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
+#endif
+#endif
+
/* build up connection name, and connect to database */
#ifndef _MSC_VER
snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);