diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-21 14:14:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-21 14:14:19 +0000 |
commit | 042594bb502f4199a3e4e676c01c8375f6cdcb48 (patch) | |
tree | f7c00d4667feb4b504e7621a53578a1b8f8292ba /include/ruby | |
parent | 82b8467e23757a01805698bf0e982fa3b93d9310 (diff) | |
download | ruby-042594bb502f4199a3e4e676c01c8375f6cdcb48.tar.gz |
ruby.h: RB_UNUSED_VAR from UNINITIALIZED_VAR
* include/ruby/ruby.h (RB_UNUSED_VAR): move code from
UNINITIALIZED_VAR() in vm_core.h.
* vm_core.h (UNINITIALIZED_VAR): use RB_UNUSED_VAR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/ruby.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 70b6769ec0..947927ba7c 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -529,8 +529,10 @@ 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)) +#if (defined(__clang__) && (__clang_major__ == 4 && __clang_minor__ == 2)) +#define RB_UNUSED_VAR(x) x __attribute__ ((unused)) +#elif defined(__GNUC__) && __GNUC__ >= 3 +#define RB_UNUSED_VAR(x) x = x #else #define RB_UNUSED_VAR(x) x #endif |