Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ee8005

Browse files
committed
Fix up ecpg's configuration so it handles "long long int" in MSVC builds.
Although configure-based builds correctly define HAVE_LONG_LONG_INT when appropriate (in both pg_config.h and ecpg_config.h), builds using the MSVC scripts failed to do so. This currently has no impact on the backend, since it uses that symbol nowhere; but it does prevent ecpg from supporting "long long int". Fix that. Also, adjust Solution.pm so that in the constructed ecpg_config.h file, the "#if (_MSC_VER > 1200)" covers only the LONG_LONG_INT-related #defines, not the whole file. AFAICS this was a thinko on somebody's part: ENABLE_THREAD_SAFETY should always be defined in Windows builds, and in branches using USE_INTEGER_DATETIMES, the setting of that shouldn't depend on the compiler version either. If I'm wrong, I imagine the buildfarm will say so. Per bug #15080 from Jonathan Allen; issue diagnosed by Michael Meskes and Andrew Gierth. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected]
1 parent df3962c commit 7ee8005

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/include/pg_config.h.win32

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@
226226
/* Define to 1 if `long int' works and is 64 bits. */
227227
/* #undef HAVE_LONG_INT_64 */
228228

229+
/* Define to 1 if the system has the type `long long int'. */
230+
#if (_MSC_VER > 1200)
231+
#define HAVE_LONG_LONG_INT 1
232+
#endif
233+
229234
/* Define to 1 if `long long int' works and is 64 bits. */
230235
#if (_MSC_VER > 1200)
231236
#define HAVE_LONG_LONG_INT_64 1

src/tools/msvc/Solution.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,13 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
420420
|| confess "Could not open ecpg_config.h";
421421
print O <<EOF;
422422
#if (_MSC_VER > 1200)
423+
#define HAVE_LONG_LONG_INT 1
423424
#define HAVE_LONG_LONG_INT_64 1
425+
#endif
424426
#define ENABLE_THREAD_SAFETY 1
425427
EOF
426428
print O "#define USE_INTEGER_DATETIMES 1\n"
427429
if ($self->{options}->{integer_datetimes});
428-
print O "#endif\n";
429430
close(O);
430431
}
431432

0 commit comments

Comments
 (0)