mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 18:13:58 +02:00
* include/ruby/ruby.h (RB_GC_GUARD_PTR): workaround for gcc
optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eac0bd9714
commit
2503de61fc
2 changed files with 11 additions and 2 deletions
|
@ -387,7 +387,13 @@ enum ruby_value_type {
|
|||
static inline int rb_type(VALUE obj);
|
||||
#define TYPE(x) rb_type((VALUE)(x))
|
||||
|
||||
#define RB_GC_GUARD(v) (*(volatile VALUE *)&(v))
|
||||
#ifdef __GNUC__
|
||||
#define RB_GC_GUARD_PTR(ptr) \
|
||||
__extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
|
||||
#else
|
||||
#define RB_GC_GUARD_PTR(ptr) (volatile VALUE *)(ptr)
|
||||
#endif
|
||||
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
|
||||
|
||||
void rb_check_type(VALUE,int);
|
||||
#define Check_Type(v,t) rb_check_type((VALUE)(v),t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue