agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Subject: [PATCH] Fix behavior for repeated build on Windows.
Date: Tue, 18 Feb 2020 15:29:55 +0900

Even after the function GenerateConfigHeader in Solution.pm decided
not to generate a new file, it wrongly checks for the remaining macro
defintions and stops with failure. Fix it by not doing the check if it
skipped file generation.
---
 src/tools/msvc/Solution.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 8412ef298e..cf16144b02 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -839,13 +839,14 @@ EOF
 sub GenerateConfigHeader
 {
 	my ($self, $config_header, $defines, $required) = @_;
-	my %defines_copy = %$defines;
 
 	my $config_header_in = $config_header . '.in';
 
 	if (IsNewer($config_header, $config_header_in) ||
 		IsNewer($config_header, __FILE__))
 	{
+		my %defines_copy = %$defines;
+
 		open(my $i, '<', $config_header_in)
 		  || confess "Could not open $config_header_in\n";
 		open(my $o, '>', $config_header)
@@ -884,10 +885,11 @@ sub GenerateConfigHeader
 		}
 		close($o);
 		close($i);
-	}
-	if ($required && scalar(keys %defines_copy) > 0)
-	{
-		croak "unused defines: " . join(' ', keys %defines_copy);
+
+		if ($required && scalar(keys %defines_copy) > 0)
+		{
+			croak "unused defines: " . join(' ', keys %defines_copy);
+		}
 	}
 }
 
-- 
2.18.2


----Next_Part(Tue_Feb_18_16_05_00_2020_490)----





view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: horikyota.ntt@gmail.com
  Subject: Re: [PATCH] Fix behavior for repeated build on Windows.
  In-Reply-To: <no-message-id-188685@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox