Define INLINE based on the compiler.

MSVC doesn't recognize `__attribute__`.
This commit is contained in:
Joseph Cloutier
2022-05-14 22:54:40 -04:00
parent 25f9af8a78
commit 580dfc862f

View File

@@ -5,7 +5,13 @@
#undef inline
/* How to obtain function inlining. */
#define INLINE __inline__ __attribute__((always_inline))
#if defined(__has_attribute)
#define INLINE __inline__ __attribute__((always_inline))
#elif defined(_MSC_VER)
#define INLINE __forceinline
#else
#define INLINE
#endif
/* How to obtain thread-local storage */
#define THREAD_LOCAL __thread