Update dedicated_server to use platform data types for ioctl

This commit is contained in:
Jacob Coby 2024-04-29 17:24:24 -04:00
parent 7d79d0afc9
commit 1a1e19934e

View File

@ -1,5 +1,5 @@
/*
* Descent 3
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
@ -854,10 +854,12 @@ void InitDedicatedSocket(ushort port) {
return;
}
// Make the socket non-blocking
unsigned long argp = 1;
#if defined(WIN32)
u_long argp = 1;
ioctlsocket(dedicated_listen_socket, FIONBIO, &argp);
#elif defined(__LINUX__)
int argp = 1;
ioctl(dedicated_listen_socket, FIONBIO, &argp);
#endif
}
@ -870,10 +872,12 @@ void ListenDedicatedSocket(void) {
incoming_socket = accept(dedicated_listen_socket, (SOCKADDR *)&conn_addr, &addrlen);
if (INVALID_SOCKET != incoming_socket) {
// Make the socket non-blocking
unsigned long argp = 1;
#if defined(WIN32)
u_long argp = 1;
ioctlsocket(incoming_socket, FIONBIO, &argp);
#elif defined(__LINUX__)
int argp = 1;
ioctl(incoming_socket, FIONBIO, &argp);
#endif
if (!Dedicated_allow_remote) {