Support compile with MSVC
spacewander opened this issue · 3 comments
Unfortunally, MSVC only supports a subset of C99 features, so lua-cjson can't be compiled with MSVC, especially under a low version.
Many people try to submit their pr to fix the problem, but the original author of lua-cjson is too busy to take them into effect.
So is it possible to pick up those pr and support MSVC in this fork?
Those include:
isnan
from https://github.com/mpx/lua-cjson/pull/1/files- many modification from https://github.com/mpx/lua-cjson/pull/16/files
Notice: mpx/lua-cjson just picked one of those pr, but it need to be installed via CMake. Even mpx/lua-cjson itself isn't installed via CMake by default.
And the fix doesn't work under earlier MSVC, since isnan
was first introduced in VS2013
We can setup up a testsuite on https://www.appveyor.com/ , to ensure all is well under windows platform.
Look forward to your reply.
I'm fine with MSVC fixes but I dislike cmake.
AppVeyor looks very interesting, BTW. Thanks for the pointer!
Sorry for misleading...
To fix the MSVC compiler support, CMake isn't required. Only need some preprocessors.
However, mpx/lua-cjson chooses to fix it with CMake. It is one of the reason why I think mpx/lua-cjson doesn't fix the MSVC compiler support totally.