diff options
author | Michael Meskes <meskes@postgresql.org> | 2017-08-26 19:07:25 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2017-09-14 01:17:15 +0200 |
commit | 407e660781b8c3866fe97fd5e326a078f549db61 (patch) | |
tree | d474eecf5e46f03d7211e7374e12c7e783d84b34 /src/interfaces/ecpg/test/thread/thread_implicit.pgc | |
parent | 839ee1811d053da4cdd0a44aea8fe7b011284be2 (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/thread_implicit.pgc')
-rw-r--r-- | src/interfaces/ecpg/test/thread/thread_implicit.pgc | 10 |
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 f4d7a881401..e5814acb270 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 WIN32_ONLY_COMPILER snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum); |