aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2014-05-26 09:48:02 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2014-05-26 09:48:02 +0300
commit36972f8ca14aabc0984c0ad87e5d26bac1ce3f15 (patch)
treef42af934c348f5c0a2dc668e2e45025297f1ac5b
parent40ea6cf3817d7a7ac053ed9c1d3e44910e0475c8 (diff)
downloadlibuvh-36972f8ca14aabc0984c0ad87e5d26bac1ce3f15.tar.gz
libuvh-36972f8ca14aabc0984c0ad87e5d26bac1ce3f15.zip
mingw/msys fixes
-rw-r--r--Makefile7
-rw-r--r--examples/fileserver.c3
-rw-r--r--src/uvh.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 479e14e..322c4a5 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,13 @@ LDFLAGS +=
CPPFLAGS += -Isrc
LDLIBS += -luv
+PLATFORM = $(shell uname -s | tr [A-Z] [a-z])
+
+ifeq ($(findstring mingw32,$(PLATFORM)),mingw32)
+LDLIBS += -lws2_32 -lpsapi -liphlpapi
+else
+endif
+
all: libuvh.a examples
.PHONY: examples
diff --git a/examples/fileserver.c b/examples/fileserver.c
index a61af75..9535ba7 100644
--- a/examples/fileserver.c
+++ b/examples/fileserver.c
@@ -2,7 +2,8 @@
#include <stdlib.h>
#include "../src/sds.h"
-#define MAX_PATH 512
+#include <fcntl.h>
+
#define MAX_CHUNK 1024
struct fileserver
diff --git a/src/uvh.c b/src/uvh.c
index d54b44e..48416ee 100644
--- a/src/uvh.c
+++ b/src/uvh.c
@@ -308,7 +308,7 @@ static void read_cb(uv_stream_t *stream, ssize_t nread, uv_buf_t buf)
serverp = container_of(req->req.server, struct uvh_server_private,
server);
- LOG_DEBUG("read_cb: nread: %zd, buf.len: %zd", nread, buf.len);
+ LOG_DEBUG("read_cb: nread: %d, buf.len: %d", (int)nread, (int)buf.len);
if (nread < 0)
{