[Spice-devel] [protocol] macros: Use GLib's G_DEPRECATED macro if available

Christophe Fergeau cfergeau at redhat.com
Wed Nov 9 14:59:49 UTC 2016


Hey,

On Fri, Oct 28, 2016 at 11:27:02AM +0200, Francois Gouget wrote:
> This gains us automatic support for whichever compilers GLib supports in
> this macro when used in projects that use GLib.
> 
> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
> ---
> 
> This can make sense if we consider GLib to be a platform similar to gcc, 
> MSVC: it just provides a G_XXX API instead of an __attribute((xxx)) or 
> __declspec(xxx) one.
> 
> Also note that the same thing could be done with a number of other 
> macros like SPICE_GNUC_WARN_UNUSED_RESULT, SPICE_GNUC_MAY_ALIAS, 
> SPICE_GNUC_CONST, etc. Let me know if I should submit one patch for 
> each, one for all or something else...

I believe all of these were more or less directly imported from glib.
Grepping around, I could only find SPICE_GNUC_VISIBLE, SPICE_GNUC_NORETURN,
SPICE_GNUC_UNUSED, SPICE_GNUC_PRINTF and SPICE_GNUC_DEPRECATED being
used. At this point, I'd just make sure the other ones emit a (compile
time) warning when they are used unless some magic define is set, and
drop them after a while.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161109/24007e79/attachment.sig>


More information about the Spice-devel mailing list