diff options
| author | Bruce Momjian | 2017-05-17 23:01:23 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2017-05-17 23:01:23 +0000 |
| commit | ce554810329b9b8e862eade08b598148931eb456 (patch) | |
| tree | ddc702112bdabfcdf78d1c4648614b92fd11dadd /src/tools/msvc | |
| parent | a6fd7b7a5f7bf3a8aa3f3d076cf09d922c1c6dd2 (diff) | |
Post-PG 10 beta1 pgperltidy run
Diffstat (limited to 'src/tools/msvc')
| -rw-r--r-- | src/tools/msvc/Install.pm | 16 | ||||
| -rw-r--r-- | src/tools/msvc/Mkvcbuild.pm | 26 | ||||
| -rw-r--r-- | src/tools/msvc/Solution.pm | 10 | ||||
| -rw-r--r-- | src/tools/msvc/build.pl | 9 | ||||
| -rw-r--r-- | src/tools/msvc/config_default.pl | 2 | ||||
| -rw-r--r-- | src/tools/msvc/gendef.pl | 2 | ||||
| -rw-r--r-- | src/tools/msvc/pgflex.pl | 3 | ||||
| -rw-r--r-- | src/tools/msvc/vcregress.pl | 3 |
8 files changed, 39 insertions, 32 deletions
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index cf91997758..18bded431f 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -20,12 +20,12 @@ our (@ISA, @EXPORT_OK); my $insttype; my @client_contribs = ('oid2name', 'pgbench', 'vacuumlo'); my @client_program_files = ( - 'clusterdb', 'createdb', 'createuser', - 'dropdb', 'dropuser', 'ecpg', - 'libecpg', 'libecpg_compat', 'libpgtypes', 'libpq', - 'pg_basebackup', 'pg_config', 'pg_dump', 'pg_dumpall', - 'pg_isready', 'pg_receivewal', 'pg_recvlogical', 'pg_restore', - 'psql', 'reindexdb', 'vacuumdb', @client_contribs); + 'clusterdb', 'createdb', 'createuser', 'dropdb', + 'dropuser', 'ecpg', 'libecpg', 'libecpg_compat', + 'libpgtypes', 'libpq', 'pg_basebackup', 'pg_config', + 'pg_dump', 'pg_dumpall', 'pg_isready', 'pg_receivewal', + 'pg_recvlogical', 'pg_restore', 'psql', 'reindexdb', + 'vacuumdb', @client_contribs); sub lcopy { @@ -392,8 +392,8 @@ sub GenerateTimezoneFiles print "Generating timezone files..."; - my @args = ("$conf/zic/zic", '-d', "$target/share/timezone", - '-p', "$posixrules"); + my @args = + ("$conf/zic/zic", '-d', "$target/share/timezone", '-p', "$posixrules"); foreach (@tzfiles) { my $tzfile = $_; diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 41c2804b9b..621238417d 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -35,8 +35,7 @@ my @contrib_uselibpq = ('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo'); my @contrib_uselibpgport = ('oid2name', 'pg_standby', 'vacuumlo'); my @contrib_uselibpgcommon = ('oid2name', 'pg_standby', 'vacuumlo'); my $contrib_extralibs = undef; -my $contrib_extraincludes = - { 'dblink' => ['src/backend'] }; +my $contrib_extraincludes = { 'dblink' => ['src/backend'] }; my $contrib_extrasource = { 'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ], 'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], }; @@ -54,11 +53,11 @@ my @frontend_uselibpq = ('pg_ctl', 'pg_upgrade', 'pgbench', 'psql', 'initdb'); my @frontend_uselibpgport = ( 'pg_archivecleanup', 'pg_test_fsync', 'pg_test_timing', 'pg_upgrade', - 'pg_waldump', 'pgbench'); + 'pg_waldump', 'pgbench'); my @frontend_uselibpgcommon = ( 'pg_archivecleanup', 'pg_test_fsync', 'pg_test_timing', 'pg_upgrade', - 'pg_waldump', 'pgbench'); + 'pg_waldump', 'pgbench'); my $frontend_extralibs = { 'initdb' => ['ws2_32.lib'], 'pg_restore' => ['ws2_32.lib'], @@ -72,7 +71,7 @@ my $frontend_extrasource = { 'pgbench' => [ 'src/bin/pgbench/exprscan.l', 'src/bin/pgbench/exprparse.y' ] }; my @frontend_excludes = ( - 'pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', + 'pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', 'pg_waldump', 'scripts'); sub mkvcbuild @@ -221,7 +220,7 @@ sub mkvcbuild } } die "Unable to find $solution->{options}->{tcl}/lib/tcl<version>.lib" - unless $found; + unless $found; } $libpq = $solution->AddProject('libpq', 'dll', 'interfaces', @@ -256,8 +255,7 @@ sub mkvcbuild $libpqwalreceiver->AddIncludeDir('src/interfaces/libpq'); $libpqwalreceiver->AddReference($postgres, $libpq); - my $pgoutput = $solution->AddProject( - 'pgoutput', 'dll', '', + my $pgoutput = $solution->AddProject('pgoutput', 'dll', '', 'src/backend/replication/pgoutput'); $pgoutput->AddReference($postgres); @@ -504,12 +502,14 @@ sub mkvcbuild 'hstore_plpython' . $pymajorver, 'contrib/hstore_plpython', 'plpython' . $pymajorver, 'src/pl/plpython', 'hstore', 'contrib/hstore'); - $hstore_plpython->AddDefine('PLPYTHON_LIBNAME="plpython' . $pymajorver . '"'); + $hstore_plpython->AddDefine( + 'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"'); my $ltree_plpython = AddTransformModule( 'ltree_plpython' . $pymajorver, 'contrib/ltree_plpython', 'plpython' . $pymajorver, 'src/pl/plpython', 'ltree', 'contrib/ltree'); - $ltree_plpython->AddDefine('PLPYTHON_LIBNAME="plpython' . $pymajorver . '"'); + $ltree_plpython->AddDefine( + 'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"'); } if ($solution->{options}->{perl}) @@ -586,15 +586,15 @@ sub mkvcbuild $plperl->AddReference($postgres); my $perl_path = $solution->{options}->{perl} . '\lib\CORE\perl*.lib'; my @perl_libs = - grep { /perl\d+.lib$/ } - glob($perl_path); + grep { /perl\d+.lib$/ } glob($perl_path); if (@perl_libs == 1) { $plperl->AddLibrary($perl_libs[0]); } else { - die "could not identify perl library version matching pattern $perl_path\n"; + die +"could not identify perl library version matching pattern $perl_path\n"; } # Add transform module dependent on plperl diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index dedfdcb903..70cd23b888 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -156,7 +156,7 @@ sub GenerateFiles { s{PG_VERSION "[^"]+"}{PG_VERSION "$self->{strver}$extraver"}; s{PG_VERSION_NUM \d+}{PG_VERSION_NUM $self->{numver}}; - s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " CppAsString2(_MSC_VER) ", $bits-bit"}; +s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " CppAsString2(_MSC_VER) ", $bits-bit"}; print $o $_; } print $o "#define PG_MAJORVERSION \"$self->{majorver}\"\n"; @@ -171,7 +171,8 @@ sub GenerateFiles print $o "#define USE_OPENSSL 1\n" if ($self->{options}->{openssl}); print $o "#define ENABLE_NLS 1\n" if ($self->{options}->{nls}); - print $o "#define BLCKSZ ", 1024 * $self->{options}->{blocksize}, "\n"; + print $o "#define BLCKSZ ", 1024 * $self->{options}->{blocksize}, + "\n"; print $o "#define RELSEG_SIZE ", (1024 / $self->{options}->{blocksize}) * $self->{options}->{segsize} * @@ -281,7 +282,8 @@ sub GenerateFiles 'src/include/utils/fmgrprotos.h', 'src/backend/utils/fmgrprotos.h')) { - copyFile('src/backend/utils/fmgrprotos.h', + copyFile( + 'src/backend/utils/fmgrprotos.h', 'src/include/utils/fmgrprotos.h'); } @@ -654,7 +656,7 @@ sub GetFakeConfigure my $self = shift; my $cfg = '--enable-thread-safety'; - $cfg .= ' --enable-cassert' if ($self->{options}->{asserts}); + $cfg .= ' --enable-cassert' if ($self->{options}->{asserts}); $cfg .= ' --enable-nls' if ($self->{options}->{nls}); $cfg .= ' --enable-tap-tests' if ($self->{options}->{tap_tests}); $cfg .= ' --with-ldap' if ($self->{options}->{ldap}); diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index 7246064290..744c1f7d6e 100644 --- a/src/tools/msvc/build.pl +++ b/src/tools/msvc/build.pl @@ -39,9 +39,9 @@ my $vcver = Mkvcbuild::mkvcbuild($config); # check what sort of build we are doing -my $bconf = $ENV{CONFIG} || "Release"; +my $bconf = $ENV{CONFIG} || "Release"; my $msbflags = $ENV{MSBFLAGS} || ""; -my $buildwhat = $ARGV[1] || ""; +my $buildwhat = $ARGV[1] || ""; if (uc($ARGV[0]) eq 'DEBUG') { $bconf = "Debug"; @@ -56,7 +56,7 @@ elsif (uc($ARGV[0]) ne "RELEASE") if ($buildwhat and $vcver >= 10.00) { system( - "msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf" +"msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf" ); } elsif ($buildwhat) @@ -65,7 +65,8 @@ elsif ($buildwhat) } else { - system("msbuild pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf"); + system( +"msbuild pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf"); } # report status diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl index 97f1af8b49..93f7887075 100644 --- a/src/tools/msvc/config_default.pl +++ b/src/tools/msvc/config_default.pl @@ -4,7 +4,7 @@ use warnings; our $config = { asserts => 0, # --enable-cassert - # float4byval=>1, # --disable-float4-byval, on by default + # float4byval=>1, # --disable-float4-byval, on by default # float8byval=> $platformbits == 64, # --disable-float8-byval, # off by default on 32 bit platforms, on by default on 64 bit platforms diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl index 64227c2dce..96122750f1 100644 --- a/src/tools/msvc/gendef.pl +++ b/src/tools/msvc/gendef.pl @@ -174,7 +174,7 @@ print "Generating $defname.DEF from directory $ARGV[0], platform $platform\n"; my %def = (); -while (<$ARGV[0]/*.obj>) ## no critic (RequireGlobFunction); +while (<$ARGV[0]/*.obj>) ## no critic (RequireGlobFunction); { my $objfile = $_; my $symfile = $objfile; diff --git a/src/tools/msvc/pgflex.pl b/src/tools/msvc/pgflex.pl index 67397ba644..eba06f2824 100644 --- a/src/tools/msvc/pgflex.pl +++ b/src/tools/msvc/pgflex.pl @@ -51,6 +51,7 @@ my $flexflags = ($make =~ /^$basetarg:\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : ''); system("flex $flexflags -o$output $input"); if ($? == 0) { + # Check for "%option reentrant" in .l file. my $lfile; open($lfile, '<', $input) || die "opening $input for reading: $!"; @@ -58,12 +59,14 @@ if ($? == 0) close($lfile); if ($lcode =~ /\%option\sreentrant/) { + # Reentrant scanners usually need a fix to prevent # "unused variable" warnings with older flex versions. system("perl src\\tools\\fix-old-flex-code.pl $output"); } else { + # For non-reentrant scanners we need to fix up the yywrap # macro definition to keep the MS compiler happy. # For reentrant scanners (like the core scanner) we do not diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 830be2ba05..468a62d8aa 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -182,7 +182,7 @@ sub tap_check chdir $dir; my @flags; - @flags = split(/\s+/,$ENV{PROVE_FLAGS}) if exists $ENV{PROVE_FLAGS}; + @flags = split(/\s+/, $ENV{PROVE_FLAGS}) if exists $ENV{PROVE_FLAGS}; my @args = ("prove", @flags, "t/*.pl"); @@ -526,6 +526,7 @@ sub fetchRegressOpts $m =~ s{\\\r?\n}{}g; if ($m =~ /^\s*REGRESS_OPTS\s*\+?=(.*)/m) { + # Substitute known Makefile variables, then ignore options that retain # an unhandled variable reference. Ignore anything that isn't an # option starting with "--". |
