Skip to content

Commit 9e9bef8

Browse files
committed
fix(windows): winsock instead of inet
1 parent 00b7dfe commit 9e9bef8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ COV_FILES = $(filter-out $(SRC_DIR)/lz4.c $(SRC_DIR)/network.c, $(SRC_FILES))
4949
# Platform-specific settings
5050
ifeq ($(PLATFORM),windows)
5151
TARGET := $(DIST_DIR)/cloudsync.dll
52-
LDFLAGS += -shared
52+
LDFLAGS += -shared -lws2_32
5353
# Create .def file for Windows
5454
DEF_FILE := $(BUILD_RELEASE)/cloudsync.def
5555
else ifeq ($(PLATFORM),macos)

src/cloudsync.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
#include "utils.h"
2424
#include "dbutils.h"
2525

26+
#ifdef _WIN32
27+
#include <winsock2.h>
28+
#include <ws2tcpip.h>
29+
#else
2630
#include <arpa/inet.h> // for htonl, htons, ntohl, ntohs
2731
#include <netinet/in.h> // for struct sockaddr_in, INADDR_ANY, etc. (if needed)
32+
#endif
2833

2934
#ifndef htonll
3035
#if __BIG_ENDIAN__

0 commit comments

Comments
 (0)