postgres.git / summary / log / commit / refs

commit    ef58b87df2afe91189e9ffb81b65c1127d53bc88
Author:   Andrew Dunstan <andrew@dunslane.net>
Date:     Sat Sep 01 00:38:37 2012 +0000

    Restore setting of _USE_32BIT_TIME_T to 32 bit MSVC builds.
    
    This was removed in commit cd004067742ee16ee63e55abfb4acbd5f09fbaab,
    we're not quite sure why, but there have been reports of crashes due
    to AS Perl being built with it when we are not, and it certainly
    seems like the right thing to do. There is still some uncertainty
    as to why it sometimes fails and sometimes doesn't.
    
    Original patch from Owais Khani, substantially reworked and
    extended by Andrew Dunstan.


src/tools/msvc/MSBuildProject.pm | 10 ++++++++-- src/tools/msvc/VCBuildProject.pm | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index ac99345fa6d..2e3eab6599d 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm @@ -61,16 +61,22 @@ EOF print $f <<EOF; </PropertyGroup> 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;', + { defs => "_DEBUG;DEBUG=1;$use_32bit_time_t", opt => 'Disabled', strpool => 'false', runtime => 'MultiThreadedDebugDLL' }); $self->WriteItemDefinitionGroup( $f, 'Release', - { defs => '', + { defs => "$use_32bit_time_t", opt => 'Full', strpool => 'true', runtime => 'MultiThreadedDLL' }); diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProject.pm index 1022329dce2..624682601b3 100644 --- a/src/tools/msvc/VCBuildProject.pm +++ b/src/tools/msvc/VCBuildProject.pm @@ -32,9 +32,16 @@ sub WriteHeader <Platforms><Platform Name="$self->{platform}"/></Platforms> <Configurations> 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->WriteConfiguration( $f, 'Debug', - { defs => '_DEBUG;DEBUG=1;', + { defs => "_DEBUG;DEBUG=1;$use_32bit_time_t", wholeopt => 0, opt => 0, strpool => 'false', @@ -42,7 +49,7 @@ EOF $self->WriteConfiguration( $f, 'Release', - { defs => '', + { defs => "$use_32bit_time_t", wholeopt => 0, opt => 3, strpool => 'true', [parent: c97a547a4a09]