[PATCH] build: work around jansson-2.1's API change

Pete Zaitcev zaitcev at redhat.com
Mon Jul 4 14:27:07 UTC 2011


On Mon, 04 Jul 2011 10:18:44 +0200
Jim Meyering <jim at meyering.net> wrote:

> +# Starting in jansson 2.1, file-loading functions require an
> +# additional "flags" argument.  Test for this.
> +AC_CACHE_CHECK([whether json_load_file takes 3 arguments],
> +  [iw_cv_func_jansson_flag],
> +  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> +    #include <jansson.h>
> +    json_t *f (void) { return json_load_file ("file", 0, NULL); }]])],
> +      [iw_cv_func_jansson_flag=0,],
> +      [iw_cv_func_jansson_flag=])])
> +AC_DEFINE_UNQUOTED([JANSSON_LOAD_FLAG], $iw_cv_func_jansson_flag,
> +  [Define to "0," if json_load_file and json_loads require a flags arguments.])

This looks excessively clever, but I understand what it's doing, and
it's all greppable (no combined macro names), so ACK.

-- Pete


More information about the iwhd-devel mailing list