mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Fixed compilation error with Intel Galileo (issue #299)
This commit is contained in:
		| @@ -1,6 +1,11 @@ | ||||
| ArduinoJson: change log | ||||
| ======================= | ||||
|  | ||||
| HEAD | ||||
| ---- | ||||
|  | ||||
| * Fixed compilation error with Intel Galileo (issue #299) | ||||
|  | ||||
| v5.5.0 | ||||
| ------ | ||||
|  | ||||
|   | ||||
| @@ -11,12 +11,16 @@ | ||||
| #include <stdint.h>  // for uint8_t | ||||
| #include <string.h> | ||||
|  | ||||
| #include "String.hpp" | ||||
| #include "JsonVariant.hpp" | ||||
| #include "String.hpp" | ||||
|  | ||||
| #if defined(__clang__) | ||||
| #pragma clang diagnostic push | ||||
| #pragma clang diagnostic ignored "-Wnon-virtual-dtor" | ||||
| #elif defined(__GNUC__) | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) | ||||
| #pragma GCC diagnostic push | ||||
| #endif | ||||
| #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" | ||||
| #endif | ||||
|  | ||||
| @@ -149,3 +153,11 @@ class JsonBuffer { | ||||
|   static const uint8_t DEFAULT_LIMIT = 10; | ||||
| }; | ||||
| } | ||||
|  | ||||
| #if defined(__clang__) | ||||
| #pragma clang diagnostic pop | ||||
| #elif defined(__GNUC__) | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) | ||||
| #pragma GCC diagnostic pop | ||||
| #endif | ||||
| #endif | ||||
|   | ||||
| @@ -14,6 +14,18 @@ | ||||
| #include <math.h> | ||||
| #endif | ||||
|  | ||||
| // GCC warning: "conversion to 'float' from 'double' may alter its value" | ||||
| #ifdef __GNUC__ | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) | ||||
| #pragma GCC diagnostic push | ||||
| #endif | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) | ||||
| #pragma GCC diagnostic ignored "-Wfloat-conversion" | ||||
| #else | ||||
| #pragma GCC diagnostic ignored "-Wconversion" | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Polyfills { | ||||
|  | ||||
| @@ -29,12 +41,14 @@ bool isInfinity(T x) { | ||||
|   return isinf(x); | ||||
| } | ||||
|  | ||||
| #ifdef __GLIBC__ | ||||
| #if defined(_GLIBCXX_HAVE_ISINFL) && _GLIBCXX_HAVE_ISINFL | ||||
| template <> | ||||
| inline bool isInfinity<double>(double x) { | ||||
|   return isinfl(x); | ||||
| } | ||||
| #endif | ||||
|  | ||||
| #if defined(_GLIBCXX_HAVE_ISINFF) && _GLIBCXX_HAVE_ISINFF | ||||
| template <> | ||||
| inline bool isInfinity<float>(float x) { | ||||
|   return isinff(x); | ||||
| @@ -43,3 +57,9 @@ inline bool isInfinity<float>(float x) { | ||||
| #endif | ||||
| } | ||||
| } | ||||
|  | ||||
| #if defined(__GNUC__) | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) | ||||
| #pragma GCC diagnostic pop | ||||
| #endif | ||||
| #endif | ||||
|   | ||||
| @@ -14,33 +14,41 @@ | ||||
| #include <math.h> | ||||
| #endif | ||||
|  | ||||
| // GCC warning: "conversion to 'float' from 'double' may alter its value" | ||||
| #ifdef __GNUC__ | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) | ||||
| #pragma GCC diagnostic push | ||||
| #endif | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) | ||||
| #pragma GCC diagnostic ignored "-Wfloat-conversion" | ||||
| #else | ||||
| #pragma GCC diagnostic ignored "-Wconversion" | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| namespace Polyfills { | ||||
|  | ||||
| // If Visual Studo <= 2012 | ||||
| #if defined(_MSC_VER) && _MSC_VER <= 1700 | ||||
|  | ||||
| template <typename T> | ||||
| bool isNaN(T x) { | ||||
|   return _isnan(x) != 0; | ||||
| } | ||||
| #else | ||||
|  | ||||
| template <typename T> | ||||
| bool isNaN(T x) { | ||||
|   return isnan(x); | ||||
| } | ||||
|  | ||||
| #ifdef __GLIBC__ | ||||
| template <> | ||||
| inline bool isNaN<double>(double x) { | ||||
|   return isnanl(x); | ||||
| } | ||||
|  | ||||
| template <> | ||||
| inline bool isNaN<float>(float x) { | ||||
|   return isnanf(x); | ||||
| } | ||||
| #endif | ||||
|  | ||||
| #endif | ||||
| } | ||||
| } | ||||
|  | ||||
| #if defined(__GNUC__) | ||||
| #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) | ||||
| #pragma GCC diagnostic pop | ||||
| #endif | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user