GNOME Bugzilla – Bug 661438
Implement G_GNUC_DEPRECATED/G_GNUC_DEPRECATED_FOR on Visual C++
Last modified: 2011-10-12 02:27:18 UTC
Created attachment 198760 [details] [review] Visual C++ implementation of deprecation macros Hi, As I read in bug 624001, I understand that there is a general consensus to move to use G_GNUC_DEPRECATED and G_GNUC_DEPRECATED_FOR in regards to deprecated APIs and other items in GLib-using code, which avoids breaking the build but enables a programmer to see exactly where he/she used a deprecated item. I have implemented an equivalent for Visual C++, as there exists a numerable audience that makes use of GLib (and the GTK+ stack) on Visual C++, so that a warning C4996 (usage of deprecated items) can be thrown when a deprecated API/item is used--this will also reveal the replacement that is to be used (in the case of using G_GNUC_DEPRECATED_FOR) and the exact location where the deprecated API/item is used.
Created attachment 198762 [details] [review] Updates to the GLib headers ...but this change would also require putting the G_GNUC_DEPRECATED and G_GNUC_DEPRECATED_FOR before the prototypes of the deprecated items (as in bug 624001, comment 3), so I have updated the GLib, GObject and GIO parts for this. However, I understand that this may cause problems during gtk-doc's parsing, but fixing that part is beyond what I could supply here, but I appreciate much on the understanding of this part. This is the update for the GLib headers-GObject and GIO will follow shortly. Thank you, and God bless!
Created attachment 198763 [details] [review] The updates for the GObject headers
Created attachment 198764 [details] [review] The updates for the GIO headers
I've ended up introducing new macros GLIB_DEPRECATED[_FOR], and use those in the headers now. Should work with msc, hopefully.
Hi Matthias, Thank you-I believe your approach is the better approach here-I will check the builds in a bit to double confirm and post something here if something didn't go in our preferences. God bless!
Oh, by the way, in commit 0da0411a4, would we be using this: "#define G_DEPRECATED __declspec(deprecated)" instead of "#define G_GNUC_DEPRECATED __declspec(deprecated)"? in glib/gmacros.h? Thanks, and God bless!