From ae5fbd4f84d5eb5f68bbb6377de011f34cd904db Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 19 Jun 2018 17:35:47 +0200 Subject: [PATCH] Replace __gh_errno_ptr() by socketlasterr() --- source/ControllerPatcherIncludes.hpp | 2 -- source/network/CPTCPServer.cpp | 4 +--- source/network/UDPServer.cpp | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/source/ControllerPatcherIncludes.hpp b/source/ControllerPatcherIncludes.hpp index 74d8c36..3c98edb 100644 --- a/source/ControllerPatcherIncludes.hpp +++ b/source/ControllerPatcherIncludes.hpp @@ -22,8 +22,6 @@ #include -extern int32_t * (* __gh_errno_ptr)(void); - #include #include #include diff --git a/source/network/CPTCPServer.cpp b/source/network/CPTCPServer.cpp index a94a2fe..9838eed 100644 --- a/source/network/CPTCPServer.cpp +++ b/source/network/CPTCPServer.cpp @@ -21,8 +21,6 @@ #include -#define wiiu_errno (*__gh_errno_ptr()) - CPTCPServer * CPTCPServer::instance = NULL; CPTCPServer::CPTCPServer(s32 port): TCPServer(port,CPTCPServer::getPriority()) { @@ -83,7 +81,7 @@ bool CPTCPServer::whileLoop() { } ret = checkbyte(clientfd); if (ret < 0) { - if(wiiu_errno != 6) { + if(socketlasterr() != 6) { return false; } OSSleepTicks(OSMicrosecondsToTicks(1000)); diff --git a/source/network/UDPServer.cpp b/source/network/UDPServer.cpp index d9d1bc0..4a39939 100644 --- a/source/network/UDPServer.cpp +++ b/source/network/UDPServer.cpp @@ -22,7 +22,6 @@ #include #define MAX_UDP_SIZE 0x578 -#define wiiu_errno (*__gh_errno_ptr()) CThread * UDPServer::pThread = NULL; UDPServer * UDPServer::instance = NULL; @@ -103,7 +102,7 @@ void UDPServer::DoUDPThreadInternal(){ memset(buffer,0,MAX_UDP_SIZE); n = recv(sockfd,buffer,MAX_UDP_SIZE,0); if (n < 0){ - s32 errno_ = wiiu_errno; + s32 errno_ = socketlasterr(); OSSleepTicks(OSMicrosecondsToTicks(2000)); if(errno_ != 11 && errno_ != 9){ break;