Re: Reduce the number of special cases to build contrib modules on windows - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Reduce the number of special cases to build contrib modules on windows
Date
Msg-id 1da51443-6b47-d012-cfda-254c353c5148@dunslane.net
Whole thread Raw
In response to Re: Reduce the number of special cases to build contrib modules on windows  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Reduce the number of special cases to build contrib modules on windows  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On 4/19/21 12:24 PM, Alvaro Herrera wrote:
>> diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
>> index ebb169e201..68606a296d 100644
>> --- a/src/tools/msvc/MSBuildProject.pm
>> +++ b/src/tools/msvc/MSBuildProject.pm
>> @@ -310,11 +310,12 @@ sub WriteItemDefinitionGroup
>>      my $targetmachine =
>>        $self->{platform} eq 'Win32' ? 'MachineX86' : 'MachineX64';
>>  
>> -    my $includes = $self->{includes};
>> -    unless ($includes eq '' or $includes =~ /;$/)
>> +    my $includes = "";
>> +    foreach my $inc (@{ $self->{includes} })
>>      {
>> -        $includes .= ';';
>> +        $includes .= $inc . ";";
>>      }
> Perl note: you can do this more easily as 
>
>   my $includes = join ';', @{$self->{includes}};
>   $includes .= ';' unless $includes eq '';
>

or even more simply:


    my $includes = join ';', @{$self->{includes}}, "";

cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Allowing to create LEAKPROOF functions to non-superuser
Next
From: Tom Lane
Date:
Subject: Re: "could not find pathkey item to sort" for TPC-DS queries 94-96