turn closesocket into a function (#409)

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
This commit is contained in:
Szilárd Biró 2024-09-19 21:35:37 +02:00 committed by GitHub
parent d47c7a03d4
commit 16048adbc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -23,7 +23,6 @@
#include <sys/types.h>
#include <unistd.h> // for close()
#define closesocket(x) close(x)
#define WSAEISCONN EISCONN
#define WSAEINPROGRESS EINPROGRESS
#define WSAEALREADY EALREADY
@ -46,6 +45,7 @@ int WSAStartup(int version, WSADATA* data);
int WSAGetLastError(void);
int WSACleanup(void);
int ioctlsocket(int handle, long cmd, unsigned long* argp);
int closesocket(int handle);
#endif /* _WIN32 */

View File

@ -24,4 +24,8 @@ int ioctlsocket(int handle, long cmd, unsigned long* argp) {
return fcntl(handle, F_SETFL, flags);
}
int closesocket(int handle) {
return close(handle);
}
#endif