After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 661438 - Implement G_GNUC_DEPRECATED/G_GNUC_DEPRECATED_FOR on Visual C++
Implement G_GNUC_DEPRECATED/G_GNUC_DEPRECATED_FOR on Visual C++
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-10-11 07:23 UTC by Fan, Chun-wei
Modified: 2011-10-12 02:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Visual C++ implementation of deprecation macros (2.42 KB, patch)
2011-10-11 07:23 UTC, Fan, Chun-wei
none Details | Review
Updates to the GLib headers (24.24 KB, patch)
2011-10-11 07:29 UTC, Fan, Chun-wei
none Details | Review
The updates for the GObject headers (4.24 KB, patch)
2011-10-11 07:29 UTC, Fan, Chun-wei
none Details | Review
The updates for the GIO headers (11.81 KB, patch)
2011-10-11 07:30 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2011-10-11 07:23:39 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.
Comment 1 Fan, Chun-wei 2011-10-11 07:29:13 UTC
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!
Comment 2 Fan, Chun-wei 2011-10-11 07:29:48 UTC
Created attachment 198763 [details] [review]
The updates for the GObject headers
Comment 3 Fan, Chun-wei 2011-10-11 07:30:22 UTC
Created attachment 198764 [details] [review]
The updates for the GIO headers
Comment 4 Matthias Clasen 2011-10-11 17:46:52 UTC
I've ended up introducing new macros GLIB_DEPRECATED[_FOR], and use those in the headers now. Should work with msc, hopefully.
Comment 5 Fan, Chun-wei 2011-10-12 02:23:56 UTC
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!
Comment 6 Fan, Chun-wei 2011-10-12 02:27:18 UTC
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!