Skip to content

Commit

Permalink
Build fixes for OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
brad0 committed May 20, 2023
1 parent 91f5a27 commit 3518abb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Core/HLE/proAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions Core/HLE/sceNetAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#endif

#if !defined(_WIN32)
#include <sys/types.h>
#include <netinet/tcp.h>
#endif

Expand Down
2 changes: 2 additions & 0 deletions ppsspp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3518abb

Please sign in to comment.