Build fixes for OpenBSD

This commit is contained in:
Brad Smith 2023-05-19 22:04:36 -04:00
parent 91f5a27fb1
commit 3518abb47d
4 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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 <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>

View File

@ -21,6 +21,7 @@
#endif
#if !defined(_WIN32)
#include <sys/types.h>
#include <netinet/tcp.h>
#endif

View File

@ -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)