build: Allow building with released libgpg-error.
authorWerner Koch <wk@gnupg.org>
Fri, 23 Mar 2018 11:36:19 +0000 (12:36 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 23 Mar 2018 11:36:19 +0000 (12:36 +0100)
* src/gpgme-json.c (add_base64_to_object): Return an error if building
with an older libgpg-error.

Signed-off-by: Werner Koch <wk@gnupg.org>
src/gpgme-json.c

index 6ba79e5..09b34bb 100644 (file)
@@ -147,6 +147,9 @@ xjson_AddBoolToObject (cjson_t object, const char *name, int abool)
 static gpg_error_t
 add_base64_to_object (cjson_t object, const char *name, gpgme_data_t data)
 {
+#if GPGRT_VERSION_NUMBER < 0x011d00 /* 1.29 */
+  return gpg_error (GPG_ERR_NOT_SUPPORTED);
+#else
   gpg_err_code_t err;
   estream_t fp = NULL;
   gpgrt_b64state_t state = NULL;
@@ -220,6 +223,7 @@ add_base64_to_object (cjson_t object, const char *name, gpgme_data_t data)
   es_fclose (fp);
   gpgme_data_release (data);
   return err;
+#endif
 }