diff --git a/include/ctll/utilities.hpp b/include/ctll/utilities.hpp index c596c5de..e726ac91 100644 --- a/include/ctll/utilities.hpp +++ b/include/ctll/utilities.hpp @@ -3,7 +3,9 @@ #include -#ifdef _MSC_VER +#if defined(__clang__) || defined(__GNUC__) +#define CTLL_FORCE_INLINE __attribute__((always_inline)) +#elif defined(_MSC_VER) #define CTLL_FORCE_INLINE __forceinline #else #define CTLL_FORCE_INLINE __attribute__((always_inline)) diff --git a/include/ctre/evaluation.hpp b/include/ctre/evaluation.hpp index 6701c6fa..074a40f5 100644 --- a/include/ctre/evaluation.hpp +++ b/include/ctre/evaluation.hpp @@ -12,7 +12,7 @@ #include // remove me when MSVC fix the constexpr bug -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) && !defined(__GNUC__) #ifndef CTRE_MSVC_GREEDY_WORKAROUND #define CTRE_MSVC_GREEDY_WORKAROUND #endif diff --git a/include/ctre/utility.hpp b/include/ctre/utility.hpp index 2ecea8e9..d0a67f71 100644 --- a/include/ctre/utility.hpp +++ b/include/ctre/utility.hpp @@ -18,7 +18,10 @@ #define CTRE_UNLIKELY #endif -#ifdef _MSC_VER +#if defined(__clang__) || defined(__GNUC__) +#define CTRE_FORCE_INLINE inline __attribute__((always_inline)) +#define CTRE_FLATTEN __attribute__((flatten)) +#elif defined(_MSC_VER) #define CTRE_FORCE_INLINE __forceinline #define CTRE_FLATTEN #else