rl_json icon indicating copy to clipboard operation
rl_json copied to clipboard

Configure/Compile errors for 0.15.1 under macos

Open wkechel opened this issue 1 year ago • 1 comments

Error when trying to configure/compile on macos (here Sonoma 14.4):

autoconf
configure.ac:246: warning: AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS

Compilation fails:

...
-c `echo /opt/projects/prs/g480/src/rl_json-0.15.1/generic/parser.c` -o parser.o
In file included from /opt/projects/prs/g480/src/rl_json-0.15.1/generic/parser.c:1:
/opt/projects/prs/g480/src/rl_json-0.15.1/generic/rl_jsonInt.h:16:10: fatal error: 'endian.h' file not found
#include <endian.h>
         ^~~~~~~~~~
1 error generated.

The file is not present. I tried to use <machine/endian.h>, but this fails as well with all bexxxx-functions missing:

...
-c `echo /opt/projects/prs/g480/src/rl_json-0.15.1/generic/cbor.c` -o cbor.o
/opt/projects/prs/g480/src/rl_json-0.15.1/generic/cbor.c:46:18: error: call to undeclared function 'be32toh'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        uint32_t        uval = be32toh(*(uint32_t*)p);
...

wkechel avatar Mar 22 '24 08:03 wkechel

The endian conversion functions are only used by the WIP CBOR code, which I may end up factoring out of rl_json into its own extension. Despite the claims in the CBOR standard it really isn't close to a sort of binary serialisation of JSON, the impedance mismatch is large.

Since the CBOR work is the only change since version 0.14, I'd recommend rather using that release for now. Of course the right fix is to figure out how to portably implement efficient endian conversion, but since I don't have access to a MacOS or Windows platform that will take quite a bit of work, and I'm unfortunately committed with a work deadline at the moment, so it will be some time before I can address it properly.

cyanogilvie avatar Mar 22 '24 09:03 cyanogilvie