From c4f4b5c0a6fc172f7ceedc1a0021169e7f31b941 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 26 Aug 2015 09:16:36 +0200 Subject: [PATCH] Make use of GPGRT macros is available. * src/gpgme.h.in (_GPGME_INLINE): Define using GPGRT_INLINE if possible. Fix problem with -Wundef by adding an extra "defined()". (_GPGME_GCC_VERSION): Define using GPGRT_ macro if possible. --- src/gpgme.h.in | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/gpgme.h.in b/src/gpgme.h.in index a0d9d31b..6cea2c77 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -56,28 +56,33 @@ extern "C" { /* * Check for compiler features. */ -#ifdef __GNUC__ +#ifdef GPGRT_INLINE +# define _GPGME_INLINE GPGRT_INLINE +#elif defined(__GNUC__) # define _GPGME_INLINE __inline__ -#elif __STDC_VERSION__ >= 199901L +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define _GPGME_INLINE inline #else # define _GPGME_INLINE #endif -#if __GNUC__ -#define _GPGME_GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) +#ifdef GPGRT_ATTR_DEPRECATED +# define _GPGME_DEPRECATED GPGRT_ATTR_DEPRECATED +#elif defined(__GNUC__) +# define _GPGME_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) -#if _GPGME_GCC_VERSION > 30100 -#define _GPGME_DEPRECATED __attribute__ ((__deprecated__)) -#endif +# if _GPGME_GCC_VERSION > 30100 +# define _GPGME_DEPRECATED __attribute__ ((__deprecated__)) +# else +# define _GPGME_DEPRECATED +# endif +#else +# define _GPGME_DEPRECATED #endif -#ifndef _GPGME_DEPRECATED -#define _GPGME_DEPRECATED -#endif /* The macro _GPGME_DEPRECATED_OUTSIDE_GPGME suppresses warnings for fields we must access in GPGME for ABI compatibility. */