Browse Source
[compat] re-enable startup checks and vulkan checks for unix-likes
pull/194/head
lizzie
7 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
7 changed files with
20 additions and
16 deletions
-
src/core/internal_network/network.cpp
-
src/core/internal_network/network.h
-
src/core/internal_network/socket_proxy.cpp
-
src/core/internal_network/sockets.h
-
src/video_core/renderer_opengl/gl_device.cpp
-
src/yuzu/startup_checks.cpp
-
src/yuzu/startup_checks.h
|
|
|
@ -12,7 +12,7 @@ |
|
|
|
#ifdef _WIN32
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>
|
|
|
|
#elif YUZU_UNIX
|
|
|
|
#elif defined(__unix__)
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
@ -77,7 +77,7 @@ SOCKET GetInterruptSocket() { |
|
|
|
sockaddr TranslateFromSockAddrIn(SockAddrIn input) { |
|
|
|
sockaddr_in result; |
|
|
|
|
|
|
|
#if YUZU_UNIX
|
|
|
|
#ifdef __unix__
|
|
|
|
result.sin_len = sizeof(result); |
|
|
|
#endif
|
|
|
|
|
|
|
|
@ -162,7 +162,7 @@ Errno TranslateNativeError(int e, CallType call_type = CallType::Other) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#elif YUZU_UNIX // ^ _WIN32 v YUZU_UNIX
|
|
|
|
#elif defined(__unix__) // ^ _WIN32 v __unix__
|
|
|
|
|
|
|
|
using SOCKET = int; |
|
|
|
using WSAPOLLFD = pollfd; |
|
|
|
@ -835,7 +835,7 @@ std::pair<s32, Errno> Socket::Send(std::span<const u8> message, int flags) { |
|
|
|
ASSERT(flags == 0); |
|
|
|
|
|
|
|
int native_flags = 0; |
|
|
|
#if YUZU_UNIX
|
|
|
|
#ifdef __unix__
|
|
|
|
native_flags |= MSG_NOSIGNAL; // do not send us SIGPIPE
|
|
|
|
#endif
|
|
|
|
const auto result = send(fd, reinterpret_cast<const char*>(message.data()), |
|
|
|
|
|
|
|
@ -13,7 +13,7 @@ |
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
#include <winsock2.h> |
|
|
|
#elif YUZU_UNIX |
|
|
|
#else |
|
|
|
#include <netinet/in.h> |
|
|
|
#endif |
|
|
|
|
|
|
|
@ -104,7 +104,7 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) { |
|
|
|
auto& bytes = addr.S_un.S_un_b; |
|
|
|
return IPv4Address{bytes.s_b1, bytes.s_b2, bytes.s_b3, bytes.s_b4}; |
|
|
|
} |
|
|
|
#elif YUZU_UNIX |
|
|
|
#elif defined(__unix__) |
|
|
|
constexpr IPv4Address TranslateIPv4(in_addr addr) { |
|
|
|
const u32 bytes = addr.s_addr; |
|
|
|
return IPv4Address{static_cast<u8>(bytes), static_cast<u8>(bytes >> 8), |
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
#include "core/internal_network/socket_proxy.h"
|
|
|
|
#include "network/network.h"
|
|
|
|
|
|
|
|
#if YUZU_UNIX
|
|
|
|
#ifdef __unix__
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
@ -9,7 +9,11 @@ |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#if defined(_WIN32) |
|
|
|
#elif !YUZU_UNIX |
|
|
|
// windows |
|
|
|
#elif defined(__unix__) |
|
|
|
// unix |
|
|
|
#else |
|
|
|
// haiku |
|
|
|
#error "Platform not implemented" |
|
|
|
#endif |
|
|
|
|
|
|
|
@ -24,7 +28,7 @@ struct ProxyPacket; |
|
|
|
|
|
|
|
class SocketBase { |
|
|
|
public: |
|
|
|
#ifdef YUZU_UNIX |
|
|
|
#ifdef __unix__ |
|
|
|
using SOCKET = int; |
|
|
|
static constexpr SOCKET INVALID_SOCKET = -1; |
|
|
|
static constexpr SOCKET SOCKET_ERROR = -1; |
|
|
|
|
|
|
|
@ -110,7 +110,7 @@ bool IsASTCSupported() { |
|
|
|
|
|
|
|
static bool HasSlowSoftwareAstc(std::string_view vendor_name, std::string_view renderer) { |
|
|
|
// ifdef for Unix reduces string comparisons for non-Windows drivers, and Intel
|
|
|
|
#ifdef YUZU_UNIX
|
|
|
|
#ifdef __unix__
|
|
|
|
// Sorted vaguely by how likely a vendor is to appear
|
|
|
|
if (vendor_name == "AMD") { |
|
|
|
// RadeonSI
|
|
|
|
|
|
|
|
@ -7,7 +7,7 @@ |
|
|
|
#include <cstring>
|
|
|
|
#include <processthreadsapi.h>
|
|
|
|
#include <windows.h>
|
|
|
|
#elif defined(YUZU_UNIX)
|
|
|
|
#else
|
|
|
|
#include <cstring>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <spawn.h>
|
|
|
|
@ -56,7 +56,7 @@ bool CheckEnvVars(bool* is_child) { |
|
|
|
IS_CHILD_ENV_VAR, GetLastError()); |
|
|
|
return true; |
|
|
|
} |
|
|
|
#elif defined(YUZU_UNIX)
|
|
|
|
#else
|
|
|
|
const char* startup_check_var = getenv(STARTUP_CHECK_ENV_VAR); |
|
|
|
if (startup_check_var != nullptr && |
|
|
|
std::strncmp(startup_check_var, ENV_VAR_ENABLED_TEXT, 8) == 0) { |
|
|
|
@ -110,7 +110,7 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan, bool perform_vulka |
|
|
|
STARTUP_CHECK_ENV_VAR, GetLastError()); |
|
|
|
} |
|
|
|
|
|
|
|
#elif defined(YUZU_UNIX)
|
|
|
|
#else
|
|
|
|
const int env_var_set = setenv(STARTUP_CHECK_ENV_VAR, ENV_VAR_ENABLED_TEXT, 1); |
|
|
|
if (env_var_set == -1) { |
|
|
|
const int err = errno; |
|
|
|
@ -175,7 +175,7 @@ bool SpawnChild(const char* arg0, PROCESS_INFORMATION* pi, int flags) { |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
#elif defined(YUZU_UNIX)
|
|
|
|
#else
|
|
|
|
pid_t SpawnChild(const char* arg0) { |
|
|
|
const pid_t pid = fork(); |
|
|
|
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
#include <windows.h> |
|
|
|
#elif defined(YUZU_UNIX) |
|
|
|
#else |
|
|
|
#include <sys/types.h> |
|
|
|
#endif |
|
|
|
|
|
|
|
@ -19,6 +19,6 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan, bool perform_vulka |
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
bool SpawnChild(const char* arg0, PROCESS_INFORMATION* pi, int flags); |
|
|
|
#elif defined(YUZU_UNIX) |
|
|
|
#else |
|
|
|
pid_t SpawnChild(const char* arg0); |
|
|
|
#endif |