summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanc999@yahoo.com.tw>2023-01-04 17:05:30 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2023-01-09 10:18:28 +0800
commitd661472529852c358f2ff441dcc396db3027075a (patch)
tree387120763f616f0150be9c763a112ec0bb6173e0
parent4da62c32ab6ab0c7ae3a2b332fef69c07d4dc850 (diff)
downloadglibmm-d661472529852c358f2ff441dcc396db3027075a.tar.gz
generate_wrap_init.pl.in: Disable warning C4273
... for Visual Studio builds, as GLib 2.75.x and later applied __declspec(dllimport) via macros to DLL builds of the GLib libraries, meaning that when we put the GQuark and GType function prototypes into wrap_init.cc warning C4273 will be raised as the prototypes in wrap_init.cc does not have any dllimport decorations (and would not have otherwise mattered). This allows builds with '-Dwarnings=fatal' to proceed with Visual Studio builds.
-rw-r--r--tools/generate_wrap_init.pl.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/generate_wrap_init.pl.in b/tools/generate_wrap_init.pl.in
index 50e08275..21b7b907 100644
--- a/tools/generate_wrap_init.pl.in
+++ b/tools/generate_wrap_init.pl.in
@@ -228,6 +228,10 @@ foreach my $filename_header (sort keys %deprecated)
# Declarations of glib functions.
+print "\n#ifdef _MSC_VER\n";
+print "#pragma warning( push )\n";
+print "#pragma warning( disable : 4273 ) // Disable MSVC warning C4273 in wrap_init.cc momentarily\n";
+print "#endif // _MSC_VER\n";
print "\nextern \"C\"\n";
print "{\n";
print "//Declarations of the *_get_type() functions:\n\n";
@@ -263,6 +267,9 @@ foreach my $filename_header (sort keys %exceptions)
}
print "} // extern \"C\"\n";
+print "\n#ifdef _MSC_VER\n";
+print "#pragma warning( pop )\n";
+print "#endif // _MSC_VER\n";
print "\n";
my $namespace_whole_declarations = "";