mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-05-12 16:09:42 -06:00
Fix compilation with mingw-w64 (#4365)
* cmake: apply sirit unused-command-line-argument flag only with Clang * shader_recompiler: move Opcode magic_enum range customization to opcodes.h Define the magic_enum range for Shader::Gcn::Opcode as a proper enum_range specialization in opcodes.h instead of relying on translation-unit macros in translate.cpp. This makes the customization visible where the enum is used and avoids the GCC linkage/build issue. * thread: use Windows thread naming path for MinGW-w64 Switch the thread naming guard from _MSC_VER to _WIN32 so MinGW-w64 builds use the Windows SetThreadDescription implementation instead of falling through the POSIX branch. This matches the platform rather than the compiler and avoids the MinGW-w64 build issue.
This commit is contained in:
parent
7132795b7a
commit
442a07a707
2
externals/CMakeLists.txt
vendored
2
externals/CMakeLists.txt
vendored
@ -149,7 +149,7 @@ endif()
|
||||
# sirit
|
||||
add_subdirectory(sirit)
|
||||
if (WIN32)
|
||||
target_compile_options(sirit PRIVATE "-Wno-error=unused-command-line-argument")
|
||||
target_compile_options(sirit PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wno-error=unused-command-line-argument>)
|
||||
endif()
|
||||
|
||||
# half
|
||||
|
||||
@ -170,7 +170,7 @@ bool AccurateSleep(const std::chrono::nanoseconds duration, std::chrono::nanosec
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
|
||||
// Sets the debugger-visible name of the current thread.
|
||||
void SetCurrentThreadName(const char* name) {
|
||||
@ -184,7 +184,7 @@ void SetThreadName(void* thread, const char* name) {
|
||||
SetThreadDescription(thread, UTF8ToUTF16W(name).data());
|
||||
}
|
||||
|
||||
#else // !MSVC_VER, so must be POSIX threads
|
||||
#else // !_WIN32, so must be POSIX threads
|
||||
|
||||
// MinGW with the POSIX threading model does not support pthread_setname_np
|
||||
#if !defined(_WIN32) || defined(_MSC_VER)
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
|
||||
#include "common/enum.h"
|
||||
#include "common/types.h"
|
||||
|
||||
@ -2696,3 +2698,9 @@ struct SendMsgSimm {
|
||||
};
|
||||
|
||||
} // namespace Shader::Gcn
|
||||
|
||||
template <>
|
||||
struct magic_enum::customize::enum_range<Shader::Gcn::Opcode> {
|
||||
static constexpr int min = static_cast<int>(Shader::Gcn::Opcode::S_ADD_U32);
|
||||
static constexpr int max = static_cast<int>(Shader::Gcn::Opcode::V_MAD_MIXHI_F16);
|
||||
};
|
||||
|
||||
@ -17,8 +17,6 @@
|
||||
#include "video_core/amdgpu/resource.h"
|
||||
|
||||
#include <numbers>
|
||||
#define MAGIC_ENUM_RANGE_MIN 0
|
||||
#define MAGIC_ENUM_RANGE_MAX 2143
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
|
||||
namespace Shader::Gcn {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user