aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index a27fc5d637..bad0b3f1cc 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -41,8 +41,15 @@ extern "C" {
#ifndef NOINLINE
# define NOINLINE(x) x
#endif
+#ifndef ASSUME
+# ifdef UNREACHABLE
+# define ASSUME(x) (LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
+# else
+# define ASSUME(x) ((void)0)
+# endif
+#endif
#ifndef UNREACHABLE
-# define UNREACHABLE /* unreachable */
+# define UNREACHABLE ((void)0) /* unreachable */
#endif
#ifdef __GNUC__