-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use C++ std headers. Defer to proper isfinite for MSVC and GCC. #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use C++ std headers. Defer to proper isfinite for MSVC and GCC. #218
Conversation
Copy-paste oversight on my part, sorry. I've now removed the |
I'm fine with this. (And I'll put Dani's name on the 2nd commit before merging.) But let's see if anyone finds any problems anywhere. @Dani-Hub? Will this work with previous versions of VisualStudio? |
I'm a bit concerned regarding the other header changes to the proper |
This might be a bit too 'out there', but what do you guys think of something like this sample? This removes all the nasty logic from the reader/writer, so lack of compiler support is 100% transparent and implementers can act as if everything exists natively in the Note that I did change functionality at this point. I wasn't sure why the Visual Studio logic branch did not include the I'm not sure if the |
This code wouldn't work for VS 2012, because it currently does not support variadic templates. Furthermore it is very ill-advised to add declarations to namespace
and then refer to |
Ok, never mind the I've updated the pull request to handle |
The new patch looks good to me - thanks! We could still improve it a bit by moving the logic related to |
This reverts commit 1c58876. std::snprintf() is only available in C++11, which is not provided by all compilers. Since the C library snprintf() can easily be used as a replacement on Linux systems, this patch changes jsoncpp to use the C library snprintf() instead of C++11 std::snprintf(), fixing the build error below: src/lib_json/json_writer.cpp:33:18: error: 'snprintf' is not a member of 'std' See open-source-parsers#231, open-source-parsers#224, and open-source-parsers#218.
This request contains two commits for solving two issues:
cmath
has been included in a project prior to building JsonCpp, and unifies the include format with the rest of JsonCpp to prefer the C++ standard headers.isfinite
works on certain versions of MSVC.