diff --git a/.travis.yml b/.travis.yml index 0cb1cd61..15bbf91e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,7 +105,7 @@ matrix: compiler: clang env: SCRIPT=cmake SANITIZE=address - env: SCRIPT=arduino VERSION=1.6.7 BOARD=arduino:avr:uno - - env: SCRIPT=arduino VERSION=1.8.2 BOARD=arduino:avr:uno + - env: SCRIPT=arduino VERSION=1.8.2 BOARD=arduino:samd:mkr1000 - env: SCRIPT=platformio BOARD=uno - env: SCRIPT=platformio BOARD=esp01 - compiler: clang diff --git a/CHANGELOG.md b/CHANGELOG.md index cee45370..759e46e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ ArduinoJson: change log ======================= +HEAD +---- + +* Fixed conflicts with `isnan()` and `isinf()` macros (issue #752) + v6.0.0-beta ----------- diff --git a/scripts/travis/arduino.sh b/scripts/travis/arduino.sh index 4de24c15..f4c168a5 100755 --- a/scripts/travis/arduino.sh +++ b/scripts/travis/arduino.sh @@ -1,4 +1,4 @@ -#!/bin/sh -eux +#!/bin/bash -eux /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 sleep 3 @@ -6,9 +6,13 @@ export DISPLAY=:1.0 mkdir -p /tmp/arduino curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tar.xz | tar xJ -C /tmp/arduino --strip 1 || -curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tgz | tar xz -C /tmp/arduino --strip 1 +curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tgz | tar xz -C /tmp/arduino --strip 1 export PATH=$PATH:/tmp/arduino/ - + +if [[ "$BOARD" =~ "arduino:samd:" ]]; then + arduino --install-boards arduino:samd +fi + ln -s $PWD /tmp/arduino/libraries/ArduinoJson for EXAMPLE in $PWD/examples/*/*.ino; do diff --git a/src/ArduinoJson/Polyfills/math.hpp b/src/ArduinoJson/Polyfills/math.hpp index 32417c0c..171021dd 100644 --- a/src/ArduinoJson/Polyfills/math.hpp +++ b/src/ArduinoJson/Polyfills/math.hpp @@ -6,14 +6,22 @@ namespace ArduinoJson { namespace Internals { + +// Some libraries #define isnan() and isinf() so we need to check before +// using this name + +#ifndef isnan template bool isnan(T x) { return x != x; } +#endif +#ifndef isinf template bool isinf(T x) { return x != 0.0 && x * 2 == x; } +#endif } // namespace Internals } // namespace ArduinoJson