aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src/util.h')
-rw-r--r--lang/cpp/src/util.h35
1 files changed, 1 insertions, 34 deletions
diff --git a/lang/cpp/src/util.h b/lang/cpp/src/util.h
index ed526e13..8ccb0bf5 100644
--- a/lang/cpp/src/util.h
+++ b/lang/cpp/src/util.h
@@ -68,18 +68,10 @@ static inline gpgme_keylist_mode_t add_to_gpgme_keylist_mode_t(unsigned int oldm
oldmode |= GPGME_KEYLIST_MODE_SIGS;
}
if (newmodes & GpgME::SignatureNotations) {
-#ifdef HAVE_GPGME_KEYLIST_MODE_SIG_NOTATIONS
oldmode |= GPGME_KEYLIST_MODE_SIG_NOTATIONS;
-#elif !defined(NDEBUG)
- ;//std::cerr << "GpgME: ignoring SignatureNotations keylist flag (gpgme too old)." << std::endl;
-#endif
}
if (newmodes & GpgME::Ephemeral) {
-#ifdef HAVE_GPGME_KEYLIST_MODE_EPHEMERAL
oldmode |= GPGME_KEYLIST_MODE_EPHEMERAL;
-#elif !defined(NDEBUG)
- ;//std::cerr << "GpgME: ignoring Ephemeral keylist flag (gpgme too old)." << std::endl;
-#endif
}
if (newmodes & GpgME::Validate) {
oldmode |= GPGME_KEYLIST_MODE_VALIDATE;
@@ -105,28 +97,20 @@ static inline unsigned int convert_from_gpgme_keylist_mode_t(unsigned int mode)
if (mode & GPGME_KEYLIST_MODE_SIGS) {
result |= GpgME::Signatures;
}
-#ifdef HAVE_GPGME_KEYLIST_MODE_SIG_NOTATIONS
if (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS) {
result |= GpgME::SignatureNotations;
}
-#endif
-#ifdef HAVE_GPGME_KEYLIST_MODE_EPHEMERAL
if (mode & GPGME_KEYLIST_MODE_EPHEMERAL) {
result |= GpgME::Ephemeral;
}
-#endif
if (mode & GPGME_KEYLIST_MODE_VALIDATE) {
result |= GpgME::Validate;
}
#ifndef NDEBUG
if (mode & ~(GPGME_KEYLIST_MODE_LOCAL |
GPGME_KEYLIST_MODE_EXTERN |
-#ifdef HAVE_GPGME_KEYLIST_MODE_SIG_NOTATIONS
GPGME_KEYLIST_MODE_SIG_NOTATIONS |
-#endif
-#ifdef HAVE_GPGME_KEYLIST_MODE_EPHEMERAL
GPGME_KEYLIST_MODE_EPHEMERAL |
-#endif
GPGME_KEYLIST_MODE_VALIDATE |
GPGME_KEYLIST_MODE_SIGS)) {
//std::cerr << "GpgME: WARNING: gpgme_get_keylist_mode() returned an unknown flag!" << std::endl;
@@ -137,43 +121,26 @@ static inline unsigned int convert_from_gpgme_keylist_mode_t(unsigned int mode)
static inline GpgME::Notation::Flags convert_from_gpgme_sig_notation_flags_t(unsigned int flags)
{
-#ifdef HAVE_GPGME_SIG_NOTATION_FLAGS_T
unsigned int result = 0;
-#ifdef HAVE_GPGME_SIG_NOTATION_HUMAN_READABLE
if (flags & GPGME_SIG_NOTATION_HUMAN_READABLE) {
result |= GpgME::Notation::HumanReadable ;
}
-#endif
-#ifdef HAVE_GPGME_SIG_NOTATION_CRITICAL
if (flags & GPGME_SIG_NOTATION_CRITICAL) {
result |= GpgME::Notation::Critical ;
}
-#endif
return static_cast<GpgME::Notation::Flags>(result);
-#else
- return GpgME::Notation::NoFlags;
-#endif
}
-#ifdef HAVE_GPGME_SIG_NOTATION_FLAGS_T
+
static inline gpgme_sig_notation_flags_t add_to_gpgme_sig_notation_flags_t(unsigned int oldflags, unsigned int newflags)
{
unsigned int result = oldflags;
if (newflags & GpgME::Notation::HumanReadable) {
-#ifdef HAVE_GPGME_SIG_NOTATION_HUMAN_READABLE
result |= GPGME_SIG_NOTATION_HUMAN_READABLE;
-#elif !defined(NDEBUG)
- //std::cerr << "GpgME::Context: ignoring HumanReadable signature notation flag (gpgme too old)" << std::endl;
-#endif
}
if (newflags & GpgME::Notation::Critical) {
-#ifdef HAVE_GPGME_SIG_NOTATION_CRITICAL
result |= GPGME_SIG_NOTATION_CRITICAL;
-#elif !defined(NDEBUG)
- //std::cerr << "GpgME::Context: ignoring Critical signature notation flag (gpgme too old)" << std::endl;
-#endif
}
return static_cast<gpgme_sig_notation_flags_t>(result);
}
-#endif
#endif // __GPGMEPP_UTIL_H__