I’ve been working on my various C/C++ single header libraries some over the Christmas break, and while I already did an update on my work, I decided to leave json.h for its own post.

C89 Support

One requested thing over the years has been C89 support, and I was reluctant to do this mostly out of sheer laziness. I’d have to convert a bunch of comments over and remove my use of long long. This was my entire reasons for not doing it, which was dumb in hindsight. So I’ve got it working now for the people that really really care.

Single Header Support

I always maintained that having one header and one source file was the best design decision for the library. It is a big implementation in the source file, and I mostly have a distaste for having a header file where you have to do some preprocessor define in a single source file.

But single headers are so super useful for users to just copy the one file and ship it.

So I’ve done made the change to bring it into a separate header.

This will definitely result in a slower compile time when bringing in the header, but I realised that in reality you will probably only include json.h in a single file when you are interacting with the JSON. So it seemed fine overall for this as a compromise.