kazuho / picojson

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

Add PICOJSON_DISABLE_EXCEPTION macro switch to support -fno-exceptions #118

Open rhysd opened 5 years ago

rhysd commented 5 years ago

Fixes #117

For supporting -fno-exceptions compiler option, this patch adds PICOJSON_DISABLE_EXCEPTION preprocessor macro switch. When it is defined, picojson utilizes std::abort instead of throw.

I confirmed picojson.h can be compiled with clang++ -fno-exception with this patch and all tests passed by make test.

ajtulloch commented 5 years ago

Looks good IMO, this would be useful for some cases I'm interested in.

kripton commented 3 years ago

@kazuho : Anything blocking to get this merged?