mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +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
|
#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 <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -13,33 +13,10 @@
|
|||||||
|
|
||||||
#define SHUT_RDWR SD_BOTH
|
#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
|
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||||
|
|
||||||
#ifdef EAGAIN
|
|
||||||
#undef EAGAIN
|
|
||||||
#endif
|
|
||||||
#define EAGAIN WSAEWOULDBLOCK
|
#define EAGAIN WSAEWOULDBLOCK
|
||||||
|
|
||||||
#ifdef EINPROGRESS
|
|
||||||
#undef EINPROGRESS
|
|
||||||
#endif
|
|
||||||
#define EINPROGRESS WSAEINPROGRESS
|
#define EINPROGRESS WSAEINPROGRESS
|
||||||
|
|
||||||
#ifdef EINTR
|
|
||||||
#undef EINTR
|
|
||||||
#endif
|
|
||||||
#define EINTR WSAEINTR
|
#define EINTR WSAEINTR
|
||||||
|
|
||||||
#ifdef ETIMEDOUT
|
|
||||||
#undef ETIMEDOUT
|
|
||||||
#endif
|
|
||||||
#define ETIMEDOUT WSAETIMEDOUT
|
#define ETIMEDOUT WSAETIMEDOUT
|
||||||
|
|
||||||
typedef int SOCK_RET;
|
typedef int SOCK_RET;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user