Fix Windows build: add conditional headers for sys/socket.h

- Add #ifdef _WIN32 to use winsock2.h/ws2tcpip.h instead of sys/socket.h
- Update build.sh to support both Linux and Windows/MSYS2
- Auto-detect platform and configure accordingly (--host=x86_64-w64-mingw32 for Windows)
- All 22 tests pass on Linux
This commit is contained in:
Evgeny committed 2026-02-15 02:39:02 +03:00
1 parent 15b670e563
commit b0fd7d60a0
2 files changed
+122 -5

No files matched your search

+10 -5
View File
@@ -3,11 +3,16 @@
* Provides flexible control over debug output without recompilation
*/
#ifndef DEBUG_CONFIG_H
#define DEBUG_CONFIG_H
#include <sys/socket.h> // struct sockaddr_storage
#include <stddef.h> // size_t
#ifndef DEBUG_CONFIG_H
#define DEBUG_CONFIG_H
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h> // struct sockaddr_storage
#endif
#include <stddef.h> // size_t
#include <stdint.h>
#include <stddef.h>
#include <time.h>