From 98e2447ec8e607eb5e5c505817a770b74914dd59 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 26 May 2022 02:58:26 +0200 Subject: [PATCH] common: Add macro to force inlining --- source/common.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/common.hpp b/source/common.hpp index 2ab5ec6a..3942405c 100644 --- a/source/common.hpp +++ b/source/common.hpp @@ -109,3 +109,13 @@ extern "C" { #define __FUNCTION_SIG__ __func__ #define __FUNCTION_NAME__ __func__ #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