support native windows binary compilation

* add winsock2 to globals.c

* add winsocket2 compatibility to main function

* add winsocket2 to packets.c

* and winsocket2 to procedures.c

* add winsocket 2 compatibility to tools.c

* add winsocket2 to varnum.c

* add mingw64 linker options to build.sh

* fix build

* style nitpicks

* remove old_fd

* update compilation instructions for windows

---------

Co-authored-by: p2r3 <41925384+p2r3@users.noreply.github.com>
This commit is contained in:
jcfb
2025-09-14 15:11:56 +01:00
committed by GitHub
parent f6333429eb
commit 26f068bc09
8 changed files with 115 additions and 16 deletions

View File

@@ -13,6 +13,15 @@ case "$OSTYPE" in
*) exe="" ;;
esac
# mingw64-specific linker options
windows_linker=""
unameOut="$(uname -s)"
case "$unameOut" in
MINGW64_NT*)
windows_linker="-static -lws2_32 -pthread"
;;
esac
rm -f "bareiron$exe"
gcc src/*.c -O3 -Iinclude -o "bareiron$exe"
gcc src/*.c -O3 -Iinclude -o "bareiron$exe" $windows_linker
"./bareiron$exe"