diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i index 492326b8..f3d14a7d 100644 --- a/lang/python/gpgme.i +++ b/lang/python/gpgme.i @@ -21,6 +21,12 @@ %include "cpointer.i" %include "cstring.i" +%{ +/* We use public symbols (eg. "_obsolete_class") which are marked as + * deprecated but we need to keep them. Silence the warning. */ +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +%} + /* Generate doc strings for all methods. This will generate docstrings of the form @@ -575,7 +581,8 @@ off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence=SEEK_SET); %} /* This is for notations, where we want to hide the length fields, and - the unused bit field block. */ + * the unused bit field block. We silence the warning. */ +%warnfilter(302) _gpgme_sig_notation; struct _gpgme_sig_notation { struct _gpgme_sig_notation *next; diff --git a/src/gpgme.h.in b/src/gpgme.h.in index e4ea466c..9c9ea5af 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -95,6 +95,12 @@ extern "C" { #define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b) _GPGME_DEPRECATED(a,b) #endif +/* We used to use some symbols which clash with keywords in some + * languages. This macro is used to obsolete them. */ +#if defined(__cplusplus) || defined(SWIGPYTHON) +# define _GPGME_OBSOLETE_SOME_SYMBOLS 1 +#endif + /* Check for a matching _FILE_OFFSET_BITS definition. */ #if @NEED__FILE_OFFSET_BITS@ @@ -640,7 +646,7 @@ struct _gpgme_key_sig gpgme_error_t status; /* Deprecated; use SIG_CLASS instead. */ -#ifdef __cplusplus +#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS unsigned int _obsolete_class _GPGME_DEPRECATED(0,4); #else unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4); @@ -1466,7 +1472,7 @@ struct _gpgme_new_signature char *fpr; /* Deprecated; use SIG_CLASS instead. */ -#ifdef __cplusplus +#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS unsigned int _obsolete_class_2; #else unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);