From 5a5c2feca3fd858e70ea348822595547e6fa6c15 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 14 Aug 2017 11:48:59 -0400 Subject: Absorb -D_USE_32BIT_TIME_T switch from Perl, if relevant. Commit 3c163a7fc's original choice to ignore all #define symbols whose names begin with underscore turns out to be too simplistic. On Windows, some Perl installations are built with -D_USE_32BIT_TIME_T, and we must absorb that or we get the wrong result for sizeof(PerlInterpreter). This effectively re-reverts commit ef58b87df, which injected that symbol in a hacky way, making it apply to all of Postgres not just PL/Perl. More significantly, it did so on *all* 32-bit Windows builds, even when the Perl build to be used did not select this option; so that it fails to work properly with some newer Perl builds. By making this change, we would be introducing an ABI break in 32-bit Windows builds; but fortunately we have not used type time_t in any exported Postgres APIs in a long time. So it should be OK, both for PL/Perl itself and for third-party extensions, if an extension library is built with a different _USE_32BIT_TIME_T setting than the core code. Patch by me, based on research by Ashutosh Sharma and Robert Haas. Back-patch to all supported branches, as commit 3c163a7fc was. Discussion: https://postgr.es/m/CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com --- src/tools/msvc/MSBuildProject.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/tools/msvc/MSBuildProject.pm') diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index d7638b458ef..27329f9e361 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm @@ -63,21 +63,16 @@ EOF EOF - # We have to use this flag on 32 bit targets because the 32bit perls - # are built with it and sometimes crash if we don't. - my $use_32bit_time_t = - $self->{platform} eq 'Win32' ? '_USE_32BIT_TIME_T;' : ''; - $self->WriteItemDefinitionGroup( $f, 'Debug', - { defs => "_DEBUG;DEBUG=1;$use_32bit_time_t", + { defs => "_DEBUG;DEBUG=1", opt => 'Disabled', strpool => 'false', runtime => 'MultiThreadedDebugDLL' }); $self->WriteItemDefinitionGroup( $f, 'Release', - { defs => "$use_32bit_time_t", + { defs => "", opt => 'Full', strpool => 'true', runtime => 'MultiThreadedDLL' }); -- cgit v1.2.3