diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-23 13:43:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-23 13:43:44 +0000 |
commit | 9662ee0584083d73c5e9a4aa6db13ed431df22e2 (patch) | |
tree | a334bf26a0d805579c0f19a7b309c9b43f904116 /internal.h | |
parent | c29ad01850a994bdc9d931b341fbb494de41fd21 (diff) | |
download | ruby-9662ee0584083d73c5e9a4aa6db13ed431df22e2.tar.gz |
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
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 |