kazuho / picojson

a header-file-only, JSON parser serializer in C++
BSD 2-Clause "Simplified" License
1.12k stars 221 forks source link

use c++ includes for the int64 support #122

Closed Optiligence closed 4 years ago

Optiligence commented 4 years ago

this previously broke e.g. with PCH builds using cotire

Optiligence commented 4 years ago

I added TR1 support.

kazuho commented 4 years ago

Thanks I'd appreciate it if you could add support for bare C++03, using inttypes.h.

We've always supported C++03 and I do not think there is a necessity to change the requirements.

Optiligence commented 4 years ago

Hm, since there is no way to detect presence of TR1, this now relies on the fact that C99 headers are present. One could reason that the extern "C" version should be sufficient on its own but i seem to be hitting a bug in clang here, and having <cinttypes> in C++11+ seems to be a viable workaround.

kazuho commented 4 years ago

Thank you for the changes. I think that the code is now fine, hence merged.

It is my understanding that with the changes, the code should work in C++11, while preserving the existing behavior when C++03 is used. That's strictly an improvement, and I'm happy with that. Thank you!