aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-23 13:43:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-23 13:43:44 +0000
commit3395dbcc131fefd2cb73d0744f68d4f50102cd9d (patch)
treea334bf26a0d805579c0f19a7b309c9b43f904116 /internal.h
parent6cf9add19d90ad44a36ac4aac18a60b36219da28 (diff)
downloadruby-3395dbcc131fefd2cb73d0744f68d4f50102cd9d.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.h6
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