aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-24 05:38:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-24 05:38:07 +0000
commita7ad3d1efaa191998b524d602216f2d8746a8b71 (patch)
tree57675d82b85ab2681511240e35b190fc91905dd5 /include
parent547622308d6d5683027d63e6a66f00ccdf0da487 (diff)
downloadruby-a7ad3d1efaa191998b524d602216f2d8746a8b71.tar.gz
UNREACHABLE_RETURN
* include/ruby/ruby.h (UNREACHABLE_RETURN): UNREACHABLE at the end of non-void functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 81f3c691df..a654cddb7e 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -44,6 +44,13 @@ extern "C" {
# define ASSUME(x) ((void)(x))
# endif
#endif
+#ifndef UNREACHABLE_RETURN
+# ifdef UNREACHABLE
+# define UNREACHABLE_RETURN(val) UNREACHABLE
+# else
+# define UNREACHABLE_RETURN(val) return (val)
+# endif
+#endif
#ifndef UNREACHABLE
# define UNREACHABLE ((void)0) /* unreachable */
#endif