diff options
author | Werner Koch <[email protected]> | 2018-06-05 07:40:17 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2018-06-05 07:40:17 +0000 |
commit | 998fec8a4fbc46315fe6836980954eed402b38c5 (patch) | |
tree | 718bd42bcf1037e73948c610de5d4f6476d55da1 /src/cJSON.c | |
parent | docs: python bindings howto (diff) | |
download | gpgme-998fec8a4fbc46315fe6836980954eed402b38c5.tar.gz gpgme-998fec8a4fbc46315fe6836980954eed402b38c5.zip |
json: Allow to compile with libgpg-error < 1.28
* src/cJSON.c: Use gpgrt fucntion only if available.
--
We have a hack in gpgme-json to allow building with older libgpg-error
versions. That whole thing will not work but the instead the binary
will print an error at runtime that it needs to be build with a newer
libgcrypt. There was a little bug here for the Debian packages
libgpg-error versions which failed to build cJSON. cJSON is only
needed be the full gpgme-json but nevertheless the Makefile wants to
build it. The fix is straightforward.
GnuPG-bug-id: 3971
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/cJSON.c')
-rw-r--r-- | src/cJSON.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cJSON.c b/src/cJSON.c index cf0cb132..38cb1523 100644 --- a/src/cJSON.c +++ b/src/cJSON.c @@ -41,13 +41,13 @@ #include "cJSON.h" /* We use malloc function wrappers from gpgrt (aka libgpg-error). */ -#if 1 +#if GPGRT_VERSION_NUMBER >= 0x011c00 /* 1.28 */ # include <gpgrt.h> # define xtrymalloc(a) gpgrt_malloc ((a)) # define xtrycalloc(a,b) gpgrt_calloc ((a), (b)) # define xtrystrdup(a) gpgrt_strdup ((a)) # define xfree(a) gpgrt_free ((a)) -#else +#else /* Without gpgrt (aka libgpg-error). */ # define xtrymalloc(a) malloc ((a)) # define xtrycalloc(a,b) calloc ((a), (b)) # define xtrystrdup(a) strdup ((a)) |