Skip to content
Open
Changes from 1 commit
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
26 changes: 26 additions & 0 deletions runtime/platform/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,27 @@
*/

#define ET_NORETURN [[noreturn]]

#ifdef _MSC_VER
#define ET_NOINLINE __declspec(noinline)
#else
#define ET_NOINLINE __attribute__((noinline))
#endif

#define ET_INLINE __attribute__((always_inline)) inline

#ifdef _MSC_VER
#define ET_ALWAYS_INLINE __forceinline
#else
#define ET_ALWAYS_INLINE inline __attribute__((always_inline))
#endif

#ifdef _MSC_VER
#define ET_RESTRICT __restrict
#else
#define ET_RESTRICT __restrict__
#endif

#define ET_INLINE_ATTRIBUTE __attribute__((always_inline))

#if defined(__GNUC__)
Expand Down Expand Up @@ -173,6 +192,13 @@
using ssize_t = ptrdiff_t;
#endif

#ifdef _MSC_VER
// MSVC has issues passing static constexpr const char names as template parameter
#define ET_OP_NAME_SPECIFIER
#else
#define ET_OP_NAME_SPECIFIER constexpr
#endif

#ifdef __EXCEPTIONS
#define ET_HAS_EXCEPTIONS 1
#elif defined(_MSC_VER) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
Expand Down
Loading