Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CTRE_FORCE_INLINE when clang or gcc is integrated in MSVC #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/ctll/utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

#include <type_traits>

#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))
Expand Down
2 changes: 1 addition & 1 deletion include/ctre/evaluation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <iterator>

// 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
Expand Down
5 changes: 4 additions & 1 deletion include/ctre/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down