summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk5
-rw-r--r--util.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/config.mk b/config.mk
index 2050380..0403026 100644
--- a/config.mk
+++ b/config.mk
@@ -15,4 +15,9 @@ CFLAGS = -ansi -pedantic -Wall -Wextra -Werror -g -D_POSIX_C_SOURCE=200112L \
CC = cc
LDFLAGS =
+# mingw
+CC = gcc
+CFLAGS = -ansi -Wall -DVERSION=\"$(VERSION)\" -DWINVER=0x0501
+LDFLAGS = -lws2_32
+
LD = $(CC)
diff --git a/util.c b/util.c
index 6e341a5..1d7f9d0 100644
--- a/util.c
+++ b/util.c
@@ -3,10 +3,15 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include "util.h"
+#ifndef WINVER
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
-#include "util.h"
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
/* plundered from suckless' sic */
int dial(char *host, char *port) {