forked from bblanchon/ArduinoJson
Fixed conflicts with isnan()
and isinf()
macros (fixes #752)
This commit is contained in:
@ -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 <typename T>
|
||||
bool isnan(T x) {
|
||||
return x != x;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef isinf
|
||||
template <typename T>
|
||||
bool isinf(T x) {
|
||||
return x != 0.0 && x * 2 == x;
|
||||
}
|
||||
#endif
|
||||
} // namespace Internals
|
||||
} // namespace ArduinoJson
|
||||
|
Reference in New Issue
Block a user