summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2019-08-28 18:11:27 +0300
committerYossi Gottlieb <yossigo@gmail.com>2019-08-28 18:43:40 +0300
commit28759c4b813b15d57af148edea9cfcca4efebf3f (patch)
treee5290480e3b4be988a187f9ce825c59e4b5e95e7 /read.c
parent2020f6f329e6b9879e4da74ffe400d9ec311fac8 (diff)
Fix MSVC build.
Diffstat (limited to 'read.c')
-rw-r--r--read.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/read.c b/read.c
index 2553c01..dfe1963 100644
--- a/read.c
+++ b/read.c
@@ -31,10 +31,10 @@
#include "fmacros.h"
#include <string.h>
-#include <strings.h>
#include <stdlib.h>
#ifndef _MSC_VER
#include <unistd.h>
+#include <strings.h>
#endif
#include <assert.h>
#include <errno.h>
@@ -44,6 +44,7 @@
#include "read.h"
#include "sds.h"
+#include "win32.h"
static void __redisReaderSetError(redisReader *r, int type, const char *str) {
size_t len;
@@ -294,9 +295,9 @@ static int processLineItem(redisReader *r) {
buf[len] = '\0';
if (strcasecmp(buf,",inf") == 0) {
- d = 1.0/0.0; /* Positive infinite. */
+ d = INFINITY; /* Positive infinite. */
} else if (strcasecmp(buf,",-inf") == 0) {
- d = -1.0/0.0; /* Nevative infinite. */
+ d = -INFINITY; /* Nevative infinite. */
} else {
d = strtod((char*)buf,&eptr);
if (buf[0] == '\0' || eptr[0] != '\0' || isnan(d)) {