diff --git a/common/Pcsx2Defs.h b/common/Pcsx2Defs.h index c667ea51df..3efb7590e6 100644 --- a/common/Pcsx2Defs.h +++ b/common/Pcsx2Defs.h @@ -15,6 +15,8 @@ #pragma once +// clang-format off + #ifdef __CYGWIN__ #define __linux__ #endif @@ -197,3 +199,37 @@ static const int __pagesize = PCSX2_PAGESIZE; #define __ri __releaseinline #define __fi __forceinline #define __fc __fastcall + +// Makes sure that if anyone includes xbyak, it doesn't do anything bad +#define MIE_INTEGER_TYPE_DEFINED +#define XBYAK_ENABLE_OMITTED_OPERAND + +#ifdef __x86_64__ + #define _M_AMD64 +#endif + +#ifndef RESTRICT + #ifdef __INTEL_COMPILER + #define RESTRICT restrict + #elif defined(_MSC_VER) + #define RESTRICT __restrict + #elif defined(__GNUC__) + #define RESTRICT __restrict__ + #else + #define RESTRICT + #endif +#endif + +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif + +#ifdef __cpp_constinit + #define CONSTINIT constinit +#elif __has_attribute(require_constant_initialization) + #define CONSTINIT __attribute__((require_constant_initialization)) +#else + #define CONSTINIT +#endif + +#define ASSERT assert diff --git a/pcsx2/GS/GS.h b/pcsx2/GS/GS.h index d6c5e9f5cb..b92a59a944 100644 --- a/pcsx2/GS/GS.h +++ b/pcsx2/GS/GS.h @@ -41,10 +41,6 @@ #endif -#ifdef __x86_64__ -#define _M_AMD64 -#endif - #include "Renderers/OpenGL/GLLoader.h" #ifdef _WIN32 diff --git a/pcsx2/GS/GSVector.h b/pcsx2/GS/GSVector.h index cec90bd578..490c53c6b8 100644 --- a/pcsx2/GS/GSVector.h +++ b/pcsx2/GS/GSVector.h @@ -19,9 +19,9 @@ #pragma once #ifdef _WIN32 -# define gsforceinline __forceinline + #define gsforceinline __forceinline #else -# define gsforceinline __forceinline __inline__ + #define gsforceinline __forceinline __inline__ #endif enum Align_Mode diff --git a/pcsx2/GS/GS_types.h b/pcsx2/GS/GS_types.h index 0792fa4aac..efdd0042cd 100644 --- a/pcsx2/GS/GS_types.h +++ b/pcsx2/GS/GS_types.h @@ -25,26 +25,11 @@ typedef unsigned long long uint64; typedef signed long long int64; typedef signed long long sint64; -// Makes sure that if anyone includes xbyak, it doesn't do anything bad -#define MIE_INTEGER_TYPE_DEFINED -#define XBYAK_ENABLE_OMITTED_OPERAND #include // clang-format off -#ifndef RESTRICT - #ifdef __INTEL_COMPILER - #define RESTRICT restrict - #elif defined(_MSC_VER) - #define RESTRICT __restrict - #elif defined(__GNUC__) - #define RESTRICT __restrict__ - #else - #define RESTRICT - #endif -#endif - #ifdef _WIN32 inline std::string convert_utf16_to_utf8(const std::wstring& utf16_string) { @@ -88,19 +73,3 @@ inline FILE* px_fopen(const std::string& filename, const std::string& mode) extern void* vmalloc(size_t size, bool code); extern void vmfree(void* ptr, size_t size); - -#define countof(a) (sizeof(a) / sizeof(a[0])) - -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif - -#ifdef __cpp_constinit - #define CONSTINIT constinit -#elif __has_attribute(require_constant_initialization) - #define CONSTINIT __attribute__((require_constant_initialization)) -#else - #define CONSTINIT -#endif - -#define ASSERT assert