Handle #1529: add automatic linkage against ws2_32.lib on _WIN32 targets

This commit is contained in:
Sergey Lyubka committed 2022-04-19 18:51:28 +01:00
1 parent 944704a12d
commit 20fc8f0279
3 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ mingw:
vc98:
$(VC98) cl.exe /nologo $(CFLAGS) ../../test/pack.c /Fepack.exe
$(VC98) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) ws2_32.lib -o $(PROG).exe
$(VC98) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) /Fe$(PROG).exe
$(VC98) $(PROG).exe
clean:
+1
View File
@@ -3102,6 +3102,7 @@ struct mg_connection *mg_sntp_connect(struct mg_mgr *mgr, const char *url,
#define MG_SOCK_ERRNO WSAGetLastError()
#ifndef SO_EXCLUSIVEADDRUSE
#define SO_EXCLUSIVEADDRUSE ((int) (~SO_REUSEADDR))
#pragma comment(lib, "ws2_32.lib")
#endif
#elif MG_ARCH == MG_ARCH_FREERTOS_TCP
#define MG_SOCK_ERRNO errno
+1
View File
@@ -13,6 +13,7 @@
#define MG_SOCK_ERRNO WSAGetLastError()
#ifndef SO_EXCLUSIVEADDRUSE
#define SO_EXCLUSIVEADDRUSE ((int) (~SO_REUSEADDR))
#pragma comment(lib, "ws2_32.lib")
#endif
#elif MG_ARCH == MG_ARCH_FREERTOS_TCP
#define MG_SOCK_ERRNO errno