From 3518abb47d3f13084b28d6498ea797b414496eea Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 19 May 2023 22:04:36 -0400 Subject: [PATCH] Build fixes for OpenBSD --- Core/HLE/proAdhoc.cpp | 4 ++-- Core/HLE/sceNet.cpp | 2 +- Core/HLE/sceNetAdhoc.cpp | 1 + ppsspp_config.h | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index 6862893e032b..fcf853ec0b69 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -2087,7 +2087,7 @@ int setSockKeepAlive(int sock, bool keepalive, const int keepinvl, const int kee int optval = keepalive ? 1 : 0; int optlen = sizeof(optval); int result = setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char*)&optval, optlen); -#if !PPSSPP_PLATFORM(SWITCH) +#if !PPSSPP_PLATFORM(SWITCH) && !PPSSPP_PLATFORM(OPENBSD) if (result == 0 && keepalive) { if (getsockopt(sock, SOL_SOCKET, SO_TYPE, (char*)&optval, (socklen_t*)&optlen) == 0 && optval == SOCK_STREAM) { optlen = sizeof(optval); @@ -2099,7 +2099,7 @@ int setSockKeepAlive(int sock, bool keepalive, const int keepinvl, const int kee setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, (char*)&optval, optlen); } } -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // !PPSSPP_PLATFORM(SWITCH) && !PPSSPP_PLATFORM(OPENBSD) return result; } diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 13b87f6b6b05..2e256fffbbc6 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -15,7 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#if __linux__ || __APPLE__ +#if __linux__ || __APPLE__ || defined(__OpenBSD__) #include #include #include diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 67e570c3ae07..8abed50a501a 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -21,6 +21,7 @@ #endif #if !defined(_WIN32) +#include #include #endif diff --git a/ppsspp_config.h b/ppsspp_config.h index d819d137b3e2..c8fcc0f10d31 100644 --- a/ppsspp_config.h +++ b/ppsspp_config.h @@ -104,6 +104,8 @@ #define PPSSPP_PLATFORM_LINUX 1 #elif defined(__linux__) #define PPSSPP_PLATFORM_LINUX 1 +#elif defined(__OpenBSD__) + #define PPSSPP_PLATFORM_OPENBSD 1 #endif // Windows ARM/ARM64, and Windows UWP (all), are the only platform that don't do GL at all (until Apple finally removes it)