From 9662ee0584083d73c5e9a4aa6db13ed431df22e2 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 23 Jul 2016 13:43:44 +0000 Subject: internal.h: inline Check_Type * internal.h (Check_Type): inline check for the object type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal.h') diff --git a/internal.h b/internal.h index c59ccc5e19..edadce991a 100644 --- a/internal.h +++ b/internal.h @@ -1540,6 +1540,12 @@ VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck); /* error.c (export) */ int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data); +NORETURN(void rb_unexpected_type(VALUE,int)); +#undef Check_Type +#define Check_Type(v, t) \ + (!RB_TYPE_P((VALUE)(v), (t)) || \ + ((t) == RUBY_T_DATA && RTYPEDDATA_P(v)) ? \ + rb_unexpected_type((VALUE)(v), (t)) : (void)0) /* file.c (export) */ #ifdef HAVE_READLINK -- cgit v1.2.3