Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog committed Mar 4, 2025
1 parent f30aea2 commit 1edacae
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rts/System/ForceInline.hpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1edacae

Please sign in to comment.