From 97e05dad7ffca0d2fd496fb8e33ddcd7def6748b Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 24 Jul 2018 05:38:07 +0000 Subject: 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 --- include/ruby/ruby.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/ruby/ruby.h') 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 -- cgit v1.2.3