mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Fixed compilation on Visual Studio 2010 and 2012 (issue #107)
This commit is contained in:
		| @@ -5,6 +5,7 @@ v5.0.2 | ||||
| ------ | ||||
|  | ||||
| * Fixed Clang warning "register specifier is deprecated" (issue #102) | ||||
| * Fixed compilation on Visual Studio 2010 and 2012 (issue #107) | ||||
|  | ||||
| v5.0.1 | ||||
| ------ | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| Arduino JSON library | ||||
| ==================== | ||||
|  | ||||
| [](https://travis-ci.org/bblanchon/ArduinoJson) [](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master) | ||||
| [](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/master) [](https://travis-ci.org/bblanchon/ArduinoJson) [](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master)  | ||||
|  | ||||
| *An elegant and efficient JSON library for embedded systems.* | ||||
|  | ||||
|   | ||||
| @@ -17,6 +17,13 @@ | ||||
| #pragma GCC diagnostic ignored "-Wfloat-conversion" | ||||
| #endif | ||||
|  | ||||
| // Visual Studo 2012 didn't have isnan, nor isinf | ||||
| #if defined(_MSC_VER) && _MSC_VER <= 1700 | ||||
| #include <float.h> | ||||
| #define isnan(x) _isnan(x) | ||||
| #define isinf(x) (!_finite(x)) | ||||
| #endif | ||||
|  | ||||
| size_t Print::print(const char s[]) { | ||||
|   size_t n = 0; | ||||
|   while (*s) { | ||||
|   | ||||
| @@ -10,6 +10,11 @@ include_directories( | ||||
|  | ||||
| add_definitions(-DGTEST_HAS_PTHREAD=0) | ||||
|  | ||||
| # Workaround for Visual Studio 2012 | ||||
| if (MSVC AND MSVC_VERSION EQUAL 1700) | ||||
|   add_definitions(-D_VARIADIC_MAX=10) | ||||
| endif() | ||||
|  | ||||
| add_executable(ArduinoJsonTests  | ||||
|     ${TESTS_FILES} | ||||
| 	${INC_FILES} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user