Fixed compilation on Visual Studio 2010 and 2012 (issue #107)

This commit is contained in:
Benoit Blanchon
2015-08-27 21:47:49 +02:00
parent 01c287bc89
commit a1943e21ed
4 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,7 @@ v5.0.2
------ ------
* Fixed Clang warning "register specifier is deprecated" (issue #102) * Fixed Clang warning "register specifier is deprecated" (issue #102)
* Fixed compilation on Visual Studio 2010 and 2012 (issue #107)
v5.0.1 v5.0.1
------ ------

View File

@ -1,7 +1,7 @@
Arduino JSON library Arduino JSON library
==================== ====================
[![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master)](https://travis-ci.org/bblanchon/ArduinoJson) [![Coverage Status](https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg)](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master) [![Build status](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/master?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/master) [![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master)](https://travis-ci.org/bblanchon/ArduinoJson) [![Coverage Status](https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg)](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master)
*An elegant and efficient JSON library for embedded systems.* *An elegant and efficient JSON library for embedded systems.*

View File

@ -17,6 +17,13 @@
#pragma GCC diagnostic ignored "-Wfloat-conversion" #pragma GCC diagnostic ignored "-Wfloat-conversion"
#endif #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 Print::print(const char s[]) {
size_t n = 0; size_t n = 0;
while (*s) { while (*s) {

View File

@ -10,6 +10,11 @@ include_directories(
add_definitions(-DGTEST_HAS_PTHREAD=0) 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 add_executable(ArduinoJsonTests
${TESTS_FILES} ${TESTS_FILES}
${INC_FILES} ${INC_FILES}