Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04de9be

Browse files
committed
Disable linker warning 4197 on Win64, that is caused by the fact that we export
symbols both using __declspec(dllexport) (via the PGDLLIMPORT macro) and using full-dll-export. This works without warning on Win32, but not on Win64. In passing, fix the fact that the framework could never deal with more than one disbled linker warning - because MSVC wants commas between linker warnings, and semicolons between compiler warnings...
1 parent ce92f8b commit 04de9be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/tools/msvc/Project.pm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Project;
33
#
44
# Package that encapsulates a Visual C++ project file generation
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.24 2010/01/02 15:18:42 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.25 2010/01/05 11:12:50 mha Exp $
77
#
88
use Carp;
99
use strict;
@@ -333,7 +333,7 @@ sub DisableLinkerWarnings
333333
{
334334
my ($self, $warnings) = @_;
335335

336-
$self->{disablelinkerwarnings} .= ';' unless ($self->{disablelinkerwarnings} eq '');
336+
$self->{disablelinkerwarnings} .= ',' unless ($self->{disablelinkerwarnings} eq '');
337337
$self->{disablelinkerwarnings} .= $warnings;
338338
}
339339

@@ -348,6 +348,10 @@ sub Save
348348
$self->FullExportDLL($self->{name} . ".lib");
349349
}
350350

351+
# Warning 4197 is about double exporting, disable this per
352+
# http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99193
353+
$self->DisableLinkerWarnings('4197') if ($self->{platform} eq 'x64');
354+
351355
# Dump the project
352356
open(F, ">$self->{name}.vcproj") || croak("Could not write to $self->{name}.vcproj\n");
353357
$self->WriteHeader(*F);
@@ -494,7 +498,9 @@ sub WriteConfiguration
494498
}
495499
$libs =~ s/ $//;
496500
$libs =~ s/__CFGNAME__/$cfgname/g;
501+
497502
my $targetmachine = $self->{platform} eq 'Win32' ? 1 : 17;
503+
498504
print $f <<EOF;
499505
<Configuration Name="$cfgname|$self->{platform}" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}"
500506
ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}">

0 commit comments

Comments
 (0)