[Spice-devel] [protocol 0/3] Fixing the *_DEPRECATED set of macros

Francois Gouget fgouget at codeweavers.com
Thu Aug 18 14:50:13 UTC 2016


On Thu, 11 Aug 2016, Francois Gouget wrote:
[...]
> So here is the proposed solution:
> 
> * spice-protocol's SPICE_DEPRECATED is in a public header so keep it as 
>   is. Extend it to mean the user wants to use deprecated APIs. This 
>   includes:
>   - Defining deprecated APIs and macros (as before).
>   - Disabling warnings about the use of deprecated APIs so it takes 
>     over spice-gtk's SPICE_NO_DEPRECATED role.
> 
> * Disable spice-protocol's SPICE_GNUC_DEPRECATED warnings when 
>   SPICE_DEPRECATED is defined. 
> 
> * Add SPICE_GNUC_DEPRECATED_FOR() to spice-protocol next to 
>   SPICE_GNUC_DEPRECATED.

The drawback of that part is that it makes the new spice-protocol 
incompatible with the old spice-gtk code because it causes redefines in 
the latter. If that's not acceptable then it means we need to avoid 
macro names that spice-gtk defines without checking if they already 
exist:
    SPICE_GNUC_DEPRECATED_FOR
    SPICE_DEPRECATED_FOR 
    SPICE_DEPRECATED

Also it feels like GNUC makes these macro names too specific: they might 
be extended to work with other compilers later.

So we could use:
    SPICE_DEPRECATED_API
    SPICE_DEPRECATED_API_FOR

Suggestions?
Should I go ahead with this?

-- 
Francois Gouget <fgouget at codeweavers.com>



More information about the Spice-devel mailing list