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.
This commit is contained in:
Werner Koch 2015-08-26 09:16:36 +02:00
parent 3f53d3d5d9
commit c4f4b5c0a6
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -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. */