From f7fabd8ba3748f9cefa814a5c084630027d3963a Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Wed, 4 Oct 2017 00:10:08 +0200 Subject: [PATCH] Attempt to fix the GCC travis build --- include/continuable/detail/util.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/continuable/detail/util.hpp b/include/continuable/detail/util.hpp index 7754630..00acc2b 100644 --- a/include/continuable/detail/util.hpp +++ b/include/continuable/detail/util.hpp @@ -238,9 +238,11 @@ private: /// Hint for the compiler that this point should be unreachable [[noreturn]] inline void unreachable() { -#ifdef _MSC_VER +#if defined(_MSC_VER) __assume(false); -#elif __has_builtin(__builtin_unreachable) +#elif defined(__GNUC__) + __builtin_unreachable(); +#elif defined(__has_builtin) && __has_builtin(__builtin_unreachable) __builtin_unreachable(); #endif } @@ -248,9 +250,11 @@ private: /// Causes the application to exit abnormally because we are /// in an invalid state. [[noreturn]] inline void trap() { -#ifdef _MSC_VER +#if defined(_MSC_VER) __debugbreak(); -#elif __has_builtin(__builtin_trap) +#elif defined(__GNUC__) + __builtin_trap(); +#elif defined(__has_builtin) && __has_builtin(__builtin_trap) __builtin_trap(); #else *(volatile int*)0 = 0;