From 1edacaeea158c47658423a345c5be1f17201d4e7 Mon Sep 17 00:00:00 2001 From: LHoG <1476261+lhog@users.noreply.github.com> Date: Tue, 4 Mar 2025 02:04:41 +0100 Subject: [PATCH] Misc --- rts/System/ForceInline.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 rts/System/ForceInline.hpp diff --git a/rts/System/ForceInline.hpp b/rts/System/ForceInline.hpp new file mode 100644 index 0000000000..5ce7f43c90 --- /dev/null +++ b/rts/System/ForceInline.hpp @@ -0,0 +1,17 @@ +#pragma once + +// https://meghprkh.github.io/blog/posts/c++-force-inline/ + +#if defined(__clang__) +#define RECOIL_FORCE_INLINE [[gnu::always_inline]] [[gnu::gnu_inline]] extern inline + +#elif defined(__GNUC__) +#define RECOIL_FORCE_INLINE [[gnu::always_inline]] inline + +#elif defined(_MSC_VER) +#pragma warning(error: 4714) +#define RECOIL_FORCE_INLINE __forceinline + +#else +#error Unsupported compiler +#endif \ No newline at end of file