forked from bblanchon/ArduinoJson
Fixed conflicts with isnan() and isinf() macros (fixes #752)
This commit is contained in:
1 parent
393f352b70
commit
c3403ed72d
4 files changed
+21
-4
No files matched your search
@@ -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