aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-08-17 13:15:46 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-08-17 13:15:46 -0400
commitf7e4783ddbef9dfd269b97210f4f74d61b5d62c8 (patch)
tree394001e3eb8e29b28550f53aa0ae5d3bf3b56234
parent60b135c8262bd7d1d115de1797165a437a890a7a (diff)
downloadpostgresql-f7e4783ddbef9dfd269b97210f4f74d61b5d62c8.tar.gz
postgresql-f7e4783ddbef9dfd269b97210f4f74d61b5d62c8.zip
Further tweaks to compiler flags for PL/Perl on Windows.
It now emerges that we can only rely on Perl to tell us we must use -D_USE_32BIT_TIME_T if it's Perl 5.13.4 or later. For older versions, revert to our previous practice of assuming we need that symbol in all 32-bit Windows builds. This is not ideal, but inquiring into which compiler version Perl was built with seems far too fragile. In any case, we had not previously had complaints about these old Perl versions, so let's assume this is Good Enough. (It's still better than the situation ante commit 5a5c2feca, in that at least the effects are confined to PL/Perl rather than the whole PG build.) Back-patch to all supported versions, like 5a5c2feca and predecessors. Discussion: https://postgr.es/m/CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com
-rw-r--r--src/tools/msvc/Mkvcbuild.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 7954773c052..2160e4d096d 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -129,6 +129,18 @@ sub mkvcbuild
}
}
+ # Perl versions before 5.13.4 don't provide -D_USE_32BIT_TIME_T
+ # regardless of how they were built. On 32-bit Windows, assume
+ # such a version was built with a pre-MSVC-2005 compiler, and
+ # define the symbol anyway, so that we are compatible if we're
+ # being built with a later MSVC version.
+ push(@perl_embed_ccflags, '_USE_32BIT_TIME_T')
+ if $solution->{platform} eq 'Win32'
+ && $Config{PERL_REVISION} == 5
+ && ($Config{PERL_VERSION} < 13
+ || ( $Config{PERL_VERSION} == 13
+ && $Config{PERL_SUBVERSION} < 4));
+
# Also, a hack to prevent duplicate definitions of uid_t/gid_t
push(@perl_embed_ccflags, 'PLPERL_HAVE_UID_GID');