summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test/thread/alloc.pgc
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2017-08-26 19:07:25 +0200
committerMichael Meskes <meskes@postgresql.org>2017-09-14 01:17:15 +0200
commit407e660781b8c3866fe97fd5e326a078f549db61 (patch)
treed474eecf5e46f03d7211e7374e12c7e783d84b34 /src/interfaces/ecpg/test/thread/alloc.pgc
parent839ee1811d053da4cdd0a44aea8fe7b011284be2 (diff)
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/alloc.pgc')
-rw-r--r--src/interfaces/ecpg/test/thread/alloc.pgc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/test/thread/alloc.pgc b/src/interfaces/ecpg/test/thread/alloc.pgc
index 8e6d042d891..b13bcb860b2 100644
--- a/src/interfaces/ecpg/test/thread/alloc.pgc
+++ b/src/interfaces/ecpg/test/thread/alloc.pgc
@@ -36,16 +36,18 @@ static void* fn(void* arg)
{
int i;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
EXEC SQL BEGIN DECLARE SECTION;
int value;
char name[100];
char **r = NULL;
EXEC SQL END DECLARE SECTION;
+#ifdef WIN32
+#ifdef _MSC_VER /* requires MSVC */
+ _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
+#endif
+#endif
+
value = (long)arg;
sprintf(name, "Connection: %d", value);