diff options
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r-- | src/nvim/macros.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 5eaf97ff87..b4034fe4f7 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -154,6 +154,14 @@ # define FALLTHROUGH #endif +#if defined(__clang__) || defined(__GNUC__) +# define UNREACHABLE __builtin_unreachable() +#elif defined(_MSVC_VER) +# define UNREACHABLE __assume(false) +#else +# define UNREACHABLE +#endif + // -V:STRUCT_CAST:641 /// Change type of structure pointers: cast `struct a *` to `struct b *` |