[Kernel] Fix macro collisions with macOS system headers
Rename IPPROTO_TCP/UDP/VDP enum values to XE_IPPROTO_* to avoid collision with macOS <netinet/in.h> macros. Add #undef WAIT_ANY guard for macOS <sys/wait.h> macro.
This commit is contained in:
@@ -70,9 +70,9 @@ X_STATUS XSocket::Initialize(AddressFamily af, Type type, Protocol proto) {
|
||||
type_ = type;
|
||||
proto_ = proto;
|
||||
|
||||
if (proto == Protocol::IPPROTO_VDP) {
|
||||
if (proto == Protocol::XE_IPPROTO_VDP) {
|
||||
// VDP is a layer on top of UDP.
|
||||
proto = Protocol::IPPROTO_UDP;
|
||||
proto = Protocol::XE_IPPROTO_UDP;
|
||||
}
|
||||
|
||||
native_handle_ = socket(af, type, proto);
|
||||
|
||||
@@ -90,13 +90,13 @@ class XSocket : public XObject {
|
||||
};
|
||||
|
||||
enum Protocol {
|
||||
IPPROTO_TCP = 6,
|
||||
IPPROTO_UDP = 17,
|
||||
XE_IPPROTO_TCP = 6,
|
||||
XE_IPPROTO_UDP = 17,
|
||||
|
||||
// LIVE Voice and Data Protocol
|
||||
// https://blog.csdn.net/baozi3026/article/details/4277227
|
||||
// Format: [cbGameData][GameData(encrypted)][VoiceData(unencrypted)]
|
||||
IPPROTO_VDP = 254,
|
||||
XE_IPPROTO_VDP = 254,
|
||||
};
|
||||
|
||||
XSocket(KernelState* kernel_state);
|
||||
|
||||
@@ -222,6 +222,9 @@ struct X_KPCR {
|
||||
uint8_t unk_2AC[0x2C]; // 0x2AC
|
||||
};
|
||||
|
||||
#ifdef WAIT_ANY
|
||||
#undef WAIT_ANY
|
||||
#endif
|
||||
enum : uint16_t {
|
||||
WAIT_ALL = 0,
|
||||
WAIT_ANY = 1,
|
||||
|
||||
Reference in New Issue
Block a user