From edc08e39ef2a50ebbd23d12419dce897cd03dfab Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 24 Jan 2024 20:51:34 +0300 Subject: [PATCH] common: move FORCEINLINE from port.h to xash3d_types.h, alongside other compiler-specific attributes --- common/port.h | 8 -------- common/xash3d_types.h | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common/port.h b/common/port.h index 76189847..bb5fae12 100644 --- a/common/port.h +++ b/common/port.h @@ -35,7 +35,6 @@ GNU General Public License for more details. #define __cdecl #define __stdcall #define _inline static inline - #define FORCEINLINE inline __attribute__((always_inline)) #if XASH_POSIX #include @@ -63,13 +62,6 @@ GNU General Public License for more details. int x, y; } POINT; #else // WIN32 - #ifdef __MINGW32__ - #define _inline static inline - #define FORCEINLINE inline __attribute__((always_inline)) - #else - #define FORCEINLINE __forceinline - #endif - #define open _open #define read _read #define alloca _alloca diff --git a/common/xash3d_types.h b/common/xash3d_types.h index 7eec99ba..41c570f6 100644 --- a/common/xash3d_types.h +++ b/common/xash3d_types.h @@ -86,6 +86,8 @@ typedef uint64_t longtime_t; #define NORETURN __attribute__((noreturn)) #define NONNULL __attribute__((nonnull)) #define ALLOC_CHECK(x) __attribute__((alloc_size(x))) + #define FORCEINLINE inline __attribute__((always_inline)) + #define NOINLINE __attribute__((noinline)) #elif defined(_MSC_VER) #define EXPORT __declspec( dllexport ) #define GAME_EXPORT @@ -93,6 +95,8 @@ typedef uint64_t longtime_t; #define NORETURN #define NONNULL #define ALLOC_CHECK(x) + #define FORCEINLINE __forceinline + #define NOINLINE __declspec( noinline ) #else #define EXPORT #define GAME_EXPORT @@ -100,6 +104,8 @@ typedef uint64_t longtime_t; #define NORETURN #define NONNULL #define ALLOC_CHECK(x) + #define FORCEINLINE + #define NOINLINE #endif #if ( __GNUC__ >= 3 )