[Spice-devel,protocol,v3,1/2] macros: Use GLib's G_DEPRECATED macro if available

Submitted by Francois Gouget on Nov. 21, 2016, 6:24 p.m.

Details

Message ID dd937b27f43a0cbc8f861727279adeb2920079fe.1479752641.git.fgouget@free.fr
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Francois Gouget Nov. 21, 2016, 6:24 p.m.
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@codeweavers.com>
---
 spice/macros.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/spice/macros.h b/spice/macros.h
index a0413f3..42916b9 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -78,7 +78,9 @@ 
 #define SPICE_GNUC_NO_INSTRUMENT
 #endif  /* !__GNUC__ */
 
-#if    __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#ifdef G_DEPRECATED
+#define SPICE_GNUC_DEPRECATED  G_DEPRECATED
+#elif  __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define SPICE_GNUC_DEPRECATED  __attribute__((__deprecated__))
 #else
 #define SPICE_GNUC_DEPRECATED

Comments

Hey,

Thanks for the updated patches (I was mainly waiting for a 'go ahead'
from you on the suggestion of having both patches, I had done the
changes locally),

Acked-by: Christophe Fergeau <cfergeau@redhat.com>

and pushed.


On Mon, Nov 21, 2016 at 07:24:38PM +0100, 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@codeweavers.com>
> ---
>  spice/macros.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/spice/macros.h b/spice/macros.h
> index a0413f3..42916b9 100644
> --- a/spice/macros.h
> +++ b/spice/macros.h
> @@ -78,7 +78,9 @@
>  #define SPICE_GNUC_NO_INSTRUMENT
>  #endif  /* !__GNUC__ */
>  
> -#if    __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
> +#ifdef G_DEPRECATED
> +#define SPICE_GNUC_DEPRECATED  G_DEPRECATED
> +#elif  __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
>  #define SPICE_GNUC_DEPRECATED  __attribute__((__deprecated__))
>  #else
>  #define SPICE_GNUC_DEPRECATED
> -- 
> 2.10.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel