Browse Source

common: move FORCEINLINE from port.h to xash3d_types.h, alongside other compiler-specific attributes

master
Alibek Omarov 10 months ago
parent
commit
edc08e39ef
  1. 8
      common/port.h
  2. 6
      common/xash3d_types.h

8
common/port.h

@ -35,7 +35,6 @@ GNU General Public License for more details.
#define __cdecl #define __cdecl
#define __stdcall #define __stdcall
#define _inline static inline #define _inline static inline
#define FORCEINLINE inline __attribute__((always_inline))
#if XASH_POSIX #if XASH_POSIX
#include <unistd.h> #include <unistd.h>
@ -63,13 +62,6 @@ GNU General Public License for more details.
int x, y; int x, y;
} POINT; } POINT;
#else // WIN32 #else // WIN32
#ifdef __MINGW32__
#define _inline static inline
#define FORCEINLINE inline __attribute__((always_inline))
#else
#define FORCEINLINE __forceinline
#endif
#define open _open #define open _open
#define read _read #define read _read
#define alloca _alloca #define alloca _alloca

6
common/xash3d_types.h

@ -86,6 +86,8 @@ typedef uint64_t longtime_t;
#define NORETURN __attribute__((noreturn)) #define NORETURN __attribute__((noreturn))
#define NONNULL __attribute__((nonnull)) #define NONNULL __attribute__((nonnull))
#define ALLOC_CHECK(x) __attribute__((alloc_size(x))) #define ALLOC_CHECK(x) __attribute__((alloc_size(x)))
#define FORCEINLINE inline __attribute__((always_inline))
#define NOINLINE __attribute__((noinline))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define EXPORT __declspec( dllexport ) #define EXPORT __declspec( dllexport )
#define GAME_EXPORT #define GAME_EXPORT
@ -93,6 +95,8 @@ typedef uint64_t longtime_t;
#define NORETURN #define NORETURN
#define NONNULL #define NONNULL
#define ALLOC_CHECK(x) #define ALLOC_CHECK(x)
#define FORCEINLINE __forceinline
#define NOINLINE __declspec( noinline )
#else #else
#define EXPORT #define EXPORT
#define GAME_EXPORT #define GAME_EXPORT
@ -100,6 +104,8 @@ typedef uint64_t longtime_t;
#define NORETURN #define NORETURN
#define NONNULL #define NONNULL
#define ALLOC_CHECK(x) #define ALLOC_CHECK(x)
#define FORCEINLINE
#define NOINLINE
#endif #endif
#if ( __GNUC__ >= 3 ) #if ( __GNUC__ >= 3 )

Loading…
Cancel
Save