GNOME Bugzilla – Bug 704543
Add implementations for G_GNUC_*_IGNORE_DEPRECATIONS for Visual C++
Last modified: 2013-07-29 02:42:14 UTC
Created attachment 249617 [details] [review] Use __pragma to implement G_GNUC_*_IGNORE_DEPRECATIONS for MSVC 2008 and later Hi, When I was trying to compile GTK+, I was coming across the use of G_GNUC_BEGIN_IGNORE_DEPRECATIONS and G_GNUC_END_IGNORE_DEPRECATIONS as I was trying to get gtkrecentchooser.c (GTK+ 3.9.8+) to compile under Visual C++. Visual Studio 2008 and later provide the __pragma keyword that would allow one to specify compiler pragma options via the use of macros (in lieu of #pragma which is disallowed in macros), and one would be able to turn off warning C4996 (that is the Visual C++ warning for use of deprecated functions) for certain blocks of code by using such pragmas. It might be so that G_GNUC_BEGIN_IGNORE_DEPRECATIONS/G_GNUC_END_IGNORE_DEPRECATIONS may not be the best name for these macros (as this is not GCC), but seem to fit in the picture. I'm attaching my patch for this enhancement here, for references. With blessings, thank you!
Review of attachment 249617 [details] [review]: looks good to me, assuming you've tested it
Review of attachment 249617 [details] [review]: Hi Matthias, I have committed and pushed the patch as d0b4f59e on the master branch. Thanks for the review, with blessings.