common: Add macro to force inlining

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2022-05-26 02:58:26 +02:00
parent f160580794
commit 98e2447ec8
1 changed files with 10 additions and 0 deletions

View File

@ -109,3 +109,13 @@ extern "C" {
#define __FUNCTION_SIG__ __func__ #define __FUNCTION_SIG__ __func__
#define __FUNCTION_NAME__ __func__ #define __FUNCTION_NAME__ __func__
#endif #endif
/// Forceful inlining
#ifndef FORCE_INLINE
#ifdef _MSC_VER
#define FORCE_INLINE __force_inline
#elif defined(__GNUC__) || defined(__MINGW32__)
#define FORCE_INLINE __attribute__((always_inline))
#else
#define FORCE_INLINE inline
#endif
#endif