diff --git a/core/libs/SceTypes.hpp b/core/libs/SceTypes.hpp index 0ad627700..9866f37c1 100644 --- a/core/libs/SceTypes.hpp +++ b/core/libs/SceTypes.hpp @@ -5,7 +5,13 @@ #include #include +#if defined(__GNUC__) || defined(__clang__) typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16))); +#elif defined(_MSC_VER) +#include +#else +struct alignas(16) __m128 { float v[4]; }; +#endif using Bool = std::uint8_t; diff --git a/core/libs/prx/libc/include/specifics/gcc/SymbolAlias.hpp b/core/libs/prx/libc/include/specifics/gcc/SymbolAlias.hpp index 913498dec..6be3a1203 100644 --- a/core/libs/prx/libc/include/specifics/gcc/SymbolAlias.hpp +++ b/core/libs/prx/libc/include/specifics/gcc/SymbolAlias.hpp @@ -4,6 +4,6 @@ #define GCC_LOCAL_ALIAS(alias, target) \ asm(".local " #alias "\n.set " #alias "," #target "\n") -#define GCC_HIDDEN_FN __attribute__((visibility("hidden"))) +#define GCC_HIDDEN_FN #endif diff --git a/core/libs/prx/libc/src/specifics/x86_64/RegisterContext.cpp b/core/libs/prx/libc/src/specifics/x86_64/RegisterContext.cpp index b79fa1c3d..e67097bad 100644 --- a/core/libs/prx/libc/src/specifics/x86_64/RegisterContext.cpp +++ b/core/libs/prx/libc/src/specifics/x86_64/RegisterContext.cpp @@ -4,8 +4,8 @@ #include -extern "C" void LibcCaptureRegisters(std::uintptr_t*) __attribute__((visibility("hidden"))); -extern "C" [[noreturn]] void LibcRestoreRegisters(const std::uintptr_t*) __attribute__((visibility("hidden"))); +extern "C" void LibcCaptureRegisters(std::uintptr_t*); +extern "C" [[noreturn]] void LibcRestoreRegisters(const std::uintptr_t*); asm( ".text\n" diff --git a/core/libs/tests/ExceptionRuntime.cpp b/core/libs/tests/ExceptionRuntime.cpp index 0c40d8fb3..20e1fc8bf 100644 --- a/core/libs/tests/ExceptionRuntime.cpp +++ b/core/libs/tests/ExceptionRuntime.cpp @@ -34,8 +34,8 @@ struct Other { virtual ~Other() = default; int padding = 9; }; struct Derived : Other, Base {}; struct Virtual : virtual Base {}; -__attribute__((noinline)) void ThrowInt() { Guard guard; throw 42; } -__attribute__((noinline)) void ThrowClass() { Guard guard; throw Derived(); } +[[gnu::noinline]] void ThrowInt() { Guard guard; throw 42; } +[[gnu::noinline]] void ThrowClass() { Guard guard; throw Derived(); } struct Left : Base {}; struct Right : Base {}; @@ -47,8 +47,8 @@ struct PrivateDerived : private Derived { Base* source() { return this; } Derived* target() { return this; } }; -__attribute__((noinline)) Derived* ToDerived(Base* p) { return dynamic_cast(p); } -__attribute__((noinline)) Repeated* ToRepeated(Base* p) { return dynamic_cast(p); } +[[gnu::noinline]] Derived* ToDerived(Base* p) { return dynamic_cast(p); } +[[gnu::noinline]] Repeated* ToRepeated(Base* p) { return dynamic_cast(p); } void CheckRtti() { Repeated repeated; Base* left = static_cast(&repeated); @@ -85,7 +85,7 @@ void CheckForeign() { } int staticAttempts = 0; -__attribute__((noinline)) int StaticValue() { +[[gnu::noinline]] int StaticValue() { static int value = [] { if (++staticAttempts == 1) throw 91; return 37; }(); return value; } @@ -135,8 +135,8 @@ void CheckThreads() { for (auto& thread : threads) assert(pthread_create(&thread, nullptr, ThreadTest, nullptr) == 0); for (auto& thread : threads) assert(pthread_join(thread, nullptr) == 0); } -__attribute__((noinline)) void UncaughtThrow() { throw 19; } -__attribute__((noinline)) void NoexceptThrow() noexcept { UncaughtThrow(); } +[[gnu::noinline]] void UncaughtThrow() { throw 19; } +[[gnu::noinline]] void NoexceptThrow() noexcept { UncaughtThrow(); } void CheckTerminate(void (*function)()) { pid_t child = fork(); assert(child >= 0); @@ -150,7 +150,7 @@ void CheckTerminate(void (*function)()) { assert(WIFEXITED(status) && WEXITSTATUS(status) == 61); } struct ForcedGuard { ~ForcedGuard() { ++destroyed; } }; -__attribute__((noinline)) void ForceUnwind() { +[[gnu::noinline]] void ForceUnwind() { ForcedGuard guard; auto* exception = new _Unwind_Exception {}; _Unwind_ForcedUnwind_nid_postfix(exception,