Skip to content

Commit 7a46410

Browse files
committed
Added workaround for the compiler which has no noreturn attrib.
1 parent 42e0eef commit 7a46410

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,20 @@
5454
#endif // forceinline
5555

5656

57+
#if __has_attribute(noreturn)
58+
# define noreturn [[noreturn]]
59+
#elif defined(_MSC_VER)
60+
# define noreturn __declspec(noreturn)
61+
#else
62+
# define noreturn
63+
#endif
64+
65+
5766
inline namespace builtins
5867
{
5968

6069
#if !(__has_builtin(__builtin_unreachable) || (40500 <= COMPILER_GNUC_VERSION))
61-
[[noreturn]] inline void __builtin_unreachable() {}
70+
noreturn inline void __builtin_unreachable() {}
6271
#endif // !__builtin_unreachable
6372

6473

0 commit comments

Comments
 (0)