mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Prevent errno.h from including incompatible error codes with Winsock codes
This commit is contained in:
parent
3ae03998a2
commit
9c92c12fea
@ -1,5 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
// Prevent bogus definitions of error codes
|
||||
// that are incompatible with Winsock errors.
|
||||
#define _CRT_NO_POSIX_ERROR_CODES
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
@ -13,33 +13,10 @@
|
||||
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
|
||||
// errno.h will include incompatible definitions of these
|
||||
// values compared to what Winsock uses, so we must undef
|
||||
// them to ensure the correct value is used.
|
||||
|
||||
#ifdef EWOULDBLOCK
|
||||
#undef EWOULDBLOCK
|
||||
#endif
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
|
||||
#ifdef EAGAIN
|
||||
#undef EAGAIN
|
||||
#endif
|
||||
#define EAGAIN WSAEWOULDBLOCK
|
||||
|
||||
#ifdef EINPROGRESS
|
||||
#undef EINPROGRESS
|
||||
#endif
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
|
||||
#ifdef EINTR
|
||||
#undef EINTR
|
||||
#endif
|
||||
#define EINTR WSAEINTR
|
||||
|
||||
#ifdef ETIMEDOUT
|
||||
#undef ETIMEDOUT
|
||||
#endif
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
|
||||
typedef int SOCK_RET;
|
||||
|
Loading…
x
Reference in New Issue
Block a user