diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index fc71ebe..7a7f36d 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -22,12 +22,15 @@ sub _new VisualStudioVersion => undef, MinimumVisualStudioVersion => undef, vcver => undef, - platform => undef, }; + platform => undef, + ICUVersion => undef, }; bless($self, $classname); $self->DeterminePlatform(); my $bits = $self->{platform} eq 'Win32' ? 32 : 64; + $self->DetermineICUVersion(); + $options->{float4byval} = 1 unless exists $options->{float4byval}; $options->{float8byval} = ($bits == 64) @@ -76,6 +79,19 @@ sub DeterminePlatform print "Detected hardware platform: $self->{platform}\n"; } +sub DetermineICUVersion{ + + my $self = shift; + + # get the icu version. + my $output = `uconv -V /? 2>&1`; + $? >> 8 == 0 or die "uconv command not found"; + + $output =~ /(\d+)\.(\d+)?$/m; + $self->{ICUVersion} = $1; + print "Detected icu version : $self->{ICUVersion}\n"; +} + # Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist. # Special case - if config.pl has changed, always return 1 sub IsNewer @@ -223,6 +239,8 @@ s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, c if ($self->{options}->{icu}) { print $o "#define USE_ICU 1\n"; + print $o "#define HAVE_UCOL_STRCOLLUTF8 1\n" + if ($self->{ICUVersion} >= 50); } if (my $port = $self->{options}->{"--with-pgport"}) {