On 04/04/2015 10:27 AM, Tom Lane wrote:
Andrew Gierth <and...@tao11.riddles.org.uk> writes:
"Tom" == Tom Lane <t...@sss.pgh.pa.us> writes:
  Tom> ... btw, has anyone noticed that this patch broke hamerkop and
  Tom> bowerbird?  Or at least, it's hard to see what other recent commit
  Tom> would explain the failures they're showing.
Now that Robert committed the fix for 64bit Datum w/o USE_FLOAT8_BYVAL,
bowerbird seems fixed (hamerkop hasn't run yet).
I see nothing in the win32 stuff that tries to define USE_FLOAT8_BYVAL
on 64-bit windows, is this just an oversight or does it not actually
work there? or is it for on-disk compatibility with 32-bit windows?
That flag doesn't affect on-disk compatibility.  It could certainly break
third-party extensions, but we accept the same hazard on non-Windows with
equanimity.  I suspect this point simply wasn't revisited when we added
support for 64-bit Windows.

Having said that, I'm fine with leaving this as-is, if only because
it means we're exercising the --disable-float8-byval code paths in
the buildfarm ;-)

                        


This seems quite wrong. If we want those paths tested we should ensure that buildfarm members are set up with that explicit setting.

I think not making this the default for 64 bit MSVC builds was simply an error of omission.

The attached patch should set float8byval as the default on 64 bit MSVC builds and error out if it is explicitly set on 32 bit platforms.

cheers

andrew
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 714585f..764ba1e 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -25,11 +25,18 @@ sub _new
 		platform                   => undef, };
 	bless($self, $classname);
 
+	$self->DeterminePlatform();
+	my $bits = $self->{platform} eq 'Win32' ? 32 : 64;
+
 	# integer_datetimes is now the default
 	$options->{integer_datetimes} = 1
 	  unless exists $options->{integer_datetimes};
 	$options->{float4byval} = 1
 	  unless exists $options->{float4byval};
+	$options->{float8byval} = ($bits == 64)
+	  unless exists $options->{float8byval};
+	die "float8byval not permitted on 32 bit platforms"
+	  if  $options->{float8byval} && $bits == 32;
 	if ($options->{xml})
 	{
 		if (!($options->{xslt} && $options->{iconv}))
@@ -56,8 +63,6 @@ sub _new
 	die "Bad wal_segsize $options->{wal_segsize}"
 	  unless grep { $_ == $options->{wal_segsize} } (1, 2, 4, 8, 16, 32, 64);
 
-	$self->DeterminePlatform();
-
 	return $self;
 }
 
diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl
index e4d4810..0bee0c0 100644
--- a/src/tools/msvc/config_default.pl
+++ b/src/tools/msvc/config_default.pl
@@ -6,7 +6,10 @@ our $config = {
 	asserts => 0,    # --enable-cassert
 	  # integer_datetimes=>1,   # --enable-integer-datetimes - on is now default
 	  # float4byval=>1,         # --disable-float4-byval, on by default
-	  # float8byval=>0,         # --disable-float8-byval, off by default
+
+	  # float8byval=> $platformbits == 64, # --disable-float8-byval,
+	  # off by default on 32 bit platforms, on by default on 64 bit platforms
+
 	  # blocksize => 8,         # --with-blocksize, 8kB by default
 	  # wal_blocksize => 8,     # --with-wal-blocksize, 8kB by default
 	  # wal_segsize => 16,      # --with-wal-segsize, 16MB by default
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to