aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2017-07-16 01:01:45 +0200
committerDavid Bremner <david@tethera.net>2017-07-15 21:43:08 -0300
commit66c9b11bb05e09a7fa2a8ff390190cc16c1499e6 (patch)
tree675c212ab16b4cd74e5d477b765ae38b2f06b0f1 /crypto.c
parent606e320e472b486359cf7a44c488b29e717a3ac8 (diff)
crypto: Avoid explicit handling of GMimeCryptoContext in gmime 3
gmime 3.0 knows how to select the correct GMimeCryptoContext automatically, so a bunch of the code in notmuch can be dropped in that case. The #ifdef removal of the crypto stuff is better than #define aliasing in gmime-extra.h for this stuff. When built against gmime 3.0: * it reduces compiled code, and * it avoids initializing unused gpgme contexts (based on a patch from dkg)
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto.c b/crypto.c
index 3e8ce7ca..cc45b885 100644
--- a/crypto.c
+++ b/crypto.c
@@ -19,7 +19,7 @@
*/
#include "notmuch-client.h"
-
+#if (GMIME_MAJOR_VERSION < 3)
/* Create a GPG context (GMime 2.6) */
static notmuch_crypto_context_t *
create_gpg_context (notmuch_crypto_t *crypto)
@@ -132,3 +132,9 @@ notmuch_crypto_cleanup (notmuch_crypto_t *crypto)
return 0;
}
+#else
+int notmuch_crypto_cleanup (unused(notmuch_crypto_t *crypto))
+{
+ return 0;
+}
+#endif