windows compile issue

This commit is contained in:
Dethrace Labs 2025-05-04 00:55:59 -07:00
parent 7011508055
commit 3e9fb8e424
1 changed files with 7 additions and 7 deletions

View File

@ -1,12 +1,12 @@
// Based on https://gist.github.com/jvranish/4441299 // Based on https://gist.github.com/jvranish/4441299
#include <iphlpapi.h> #define _WIN32_WINNT 0x0600 // or higher (e.g., 0x0A00 for Windows 10)
#include <winsock2.h>
#include <ws2tcpip.h>
// this has to be first #include <iphlpapi.h> // for GetAdaptersAddresses
#include <windows.h> #include <winsock2.h>
#include <ws2tcpip.h> // for getaddrinfo, inet_pton, etc.
// //
#include <windows.h> // only after winsock2.h
#include <dbghelp.h> #include <dbghelp.h>
@ -401,7 +401,7 @@ char* OS_GetWorkingDirectory(char* argv0) {
return OS_Dirname(argv0); return OS_Dirname(argv0);
} }
int OS_GetAdapaterAddress(char* name, void* pSockaddr_in) { int OS_GetAdapterAddress(char* name, void* pSockaddr_in) {
DWORD ret, bufLen = 15000; DWORD ret, bufLen = 15000;
IP_ADAPTER_ADDRESSES* adapter_addrs = (IP_ADAPTER_ADDRESSES*)malloc(bufLen); IP_ADAPTER_ADDRESSES* adapter_addrs = (IP_ADAPTER_ADDRESSES*)malloc(bufLen);
int found = 0; int found = 0;
@ -466,7 +466,7 @@ void OS_CleanupSockets(void) {
int OS_SetSocketNonBlocking(int socket) { int OS_SetSocketNonBlocking(int socket) {
unsigned long nobio = 1; unsigned long nobio = 1;
return ioctlsocket(gSocket, FIONBIO, &nobio); return ioctlsocket(socket, FIONBIO, &nobio);
} }
int OS_CloseSocket(int socket) { int OS_CloseSocket(int socket) {