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

From David Rowley
Subject Re: Reduce the number of special cases to build contrib modules on windows
Date
Msg-id CAApHDvrPBpwToJFD3fFizVU38ZyD3xQdFkc0VT7jbPCY9=ZyOA@mail.gmail.com
Whole thread Raw
In response to Re: Reduce the number of special cases to build contrib modules on windows  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Tue, 20 Apr 2021 at 09:28, Andrew Dunstan <andrew@dunslane.net> wrote:
>
>
> 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}}, "";

Both look more compact. Thanks. I'll include this for the next version.

David



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: amcheck eating most of the runtime with wal_consistency_checking
Next
From: Julien Rouhaud
Date:
Subject: Re: Bogus collation version recording in recordMultipleDependencies