[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    ACK: [PATCH] lib: fwts_json.h: define TRUE and FALSE for newer versions of json-c (LP: #1874224)
From:       ivanhu <ivan.hu () canonical ! com>
Date:       2020-04-24 2:22:26
Message-ID: 35ff2274-38f9-a4ef-dbd1-cca0da78d6bb () canonical ! com
[Download RAW message or body]



On 4/22/20 8:40 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1874224
> 
> json-c-0.14 does not provide TRUE/FALSE defines anymore, and instead
> only uses 1/0 directly. Add in the defines for TRUE/FALSE if they
> don't exist already.
> 
> Thanks to Björn Esser for the fix from originally from
> https://src.fedoraproject.org/rpms/fwts/c/2d53ef23970e but with
> the JSON_C_VERSION_NUM removed as we don't need to be overly
> pedantic here.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/include/fwts_json.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/lib/include/fwts_json.h b/src/lib/include/fwts_json.h
> index 747c4bdb..ad51bc45 100644
> --- a/src/lib/include/fwts_json.h
> +++ b/src/lib/include/fwts_json.h
> @@ -31,4 +31,17 @@
>  #define FWTS_JSON_ERROR(ptr) \
>  	( (ptr == NULL) || ((const json_object *)ptr == __FWTS_JSON_ERR_PTR__) )
>  
> +/*
> + * json-c 0.13.99 does not define TRUE/FALSE anymore
> + * the json-c maintainers replaced them with pure 1/0
> + * https://github.com/json-c/json-c/commit/0992aac61f8b
> + */
> +#ifndef FALSE
> +#define FALSE 0
> +#endif
> +
> +#ifndef TRUE
> +#define TRUE  1
> +#endif
> +
>  #endif
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>

-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic