diff --git a/src/osgPlugins/osgjs/JSON_Objects b/src/osgPlugins/osgjs/JSON_Objects index 93584d33e..9fc24db4e 100644 --- a/src/osgPlugins/osgjs/JSON_Objects +++ b/src/osgPlugins/osgjs/JSON_Objects @@ -19,7 +19,22 @@ #include "json_stream" #ifdef WIN32 - #include + +#if !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) + +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; + +#else + +#include + +#endif + #endif class WriteVisitor; diff --git a/src/osgPlugins/osgjs/json_stream b/src/osgPlugins/osgjs/json_stream index 8cf0bd8f4..3475fd2d3 100644 --- a/src/osgPlugins/osgjs/json_stream +++ b/src/osgPlugins/osgjs/json_stream @@ -36,6 +36,12 @@ using namespace std; // * disallow some control characters // * does not support inf or nan values +#if defined(WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) +inline int isfinite( double x ) { return _finite( x ); } +inline int isinf( double x ) { return !_finite( x ) && !_isnan( x ); } +#endif + + class json_stream : public osgDB::ofstream { public: json_stream(const std::string& filename, bool strict=true) :