fix: guard O_SYNC flag with ifdef and add mingw32 libuv link libs

Guard the O_SYNC flag usage in mapFileFlags() with a preprocessor
conditional to fix compilation on Windows where this constant is not
defined. Additionally, add the required Windows socket and system
libraries (ws2_32, iphlpapi, psapi, userenv) to LIBUV_LIBS when
building under mingw32, replacing the Linux-specific pthread and rt
libraries.
This commit is contained in:
Yasuhiro Matsumoto
2016-03-08 13:05:39 +00:00
parent 5d42ce9ad6
commit d15981644a
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -103,9 +103,13 @@ else
SHARED_LIB_FLAGS := -Wl,-soname,$@.so
SHARED_EXT := so
ifeq ($(OS),mingw32)
LIBUV_LIBS := -lws2_32 -liphlpapi -lpsapi -luserenv
else
# On Linux we need to explicitly link to these for libuv.
LIBUV_LIBS := -lpthread -lrt
endif
endif
CFLAGS := $(C_OPTIONS) $(C_WARNINGS)