[OpenWrt-Devel] [PATCH 1/2] fix building with json-c.0.12
Karl Palsson
karlp at tweak.net.au
Fri Feb 27 09:20:56 EST 2015
Yousong Zhou <yszhou4tech at gmail.com> wrote:
> >
>
> The above only detects the cinclude path for json-c and is not version
> specific.
json-c is the name going forward, and has been the name for two releases
of the library already.
>
> > diff --git a/plug/hotplug.c b/plug/hotplug.c
> > index 061833a..3bf6253 100644
> > --- a/plug/hotplug.c
> > +++ b/plug/hotplug.c
> > @@ -22,7 +22,11 @@
> > #include <libubox/blobmsg_json.h>
> > #include <libubox/json_script.h>
> > #include <libubox/uloop.h>
> > -#include <json/json.h>
> > +#ifdef JSONC
> > + #include <json.h>
> > +#else
> > + #include <json/json.h>
> > +#endif
> >
>
> Original code compiles in OpenWrt because exact copy of json-c header
> files are copied to usr/include/json/ in addition to
> usr/include/json-c/. I suggest we drop this JSONC convention in
> procd, libubox, etc. and stick to pkg-config and "#include <json.h>".
>
Don't do that, <json.h> is the legacy installation path. procd is new,
and uses new json-c library, just always use the new path. Don't patch
to allow procd to keep using a style of include that hasn't been current
or standard for as long as procd has existed.
#include <json-c/json.h>
is the way it should be used.
Sincerely,
Karl Palsson
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list