aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/node.c5
-rw-r--r--tests/serd_test.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 061903bc..065ff875 100644
--- a/src/node.c
+++ b/src/node.c
@@ -22,6 +22,11 @@
#include <math.h>
#include <float.h>
+#ifdef _WIN32
+# define isnan(x) _isnan(x)
+# define isinf(x) (!_finite(x))
+#endif
+
SERD_API
SerdNode
serd_node_from_string(SerdType type, const uint8_t* buf)
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 5e37824c..259f244a 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -25,6 +25,11 @@
#define USTR(s) ((const uint8_t*)(s))
+#ifdef _WIN32
+# define INFINITY (DBL_MAX + DBL_MAX)
+# define NAN (INFINITY - INFINITY)
+#endif
+
static int
failure(const char* fmt, ...)
{