summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-13 03:09:22 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-13 03:09:22 +0000
commit3a6dec0c5daf568f4846f10fed9c115bc164871b (patch)
treee746644d3302cde5d97e671a3c5987ba65b3a751 /include
parent14d72e66858fac7297e193d116ae7363b222b398 (diff)
* include/ruby/ruby.h (RB_UNUSED_VAR): new macro to suppress
warnings for unused variables. * ext/bigdecimal/bigdecimal.c (ENTER): use RB_UNUSED_VAR() to suppress annoying warnings by -Wunused-but-set-variable in gcc 4.6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index aa0861e92c..b39cbf7864 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -529,6 +529,12 @@ static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr
#endif
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
+#ifdef __GNUC__
+#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
+#else
+#define RB_UNUSED_VAR(x) x
+#endif
+
void rb_check_type(VALUE,int);
#define Check_Type(v,t) rb_check_type((VALUE)(v),(t))