diff options
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/intern.h | 1 | ||||
-rw-r--r-- | include/ruby/ruby.h | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 67356531e3..81b93b8971 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -460,6 +460,7 @@ VALUE rb_hash_aset(VALUE, VALUE, VALUE); VALUE rb_hash_clear(VALUE); VALUE rb_hash_delete_if(VALUE); VALUE rb_hash_delete(VALUE,VALUE); +VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone); typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value); VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func); struct st_table *rb_hash_tbl(VALUE); diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 8bfd351391..9404d97d80 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -689,6 +689,11 @@ VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type); #ifndef RGENGC_WB_PROTECTED_ARRAY #define RGENGC_WB_PROTECTED_ARRAY 1 #endif + +#ifndef RGENGC_WB_PROTECTED_HASH +#define RGENGC_WB_PROTECTED_HASH 1 +#endif + #ifndef RGENGC_WB_PROTECTED_STRING #define RGENGC_WB_PROTECTED_STRING 1 #endif @@ -960,7 +965,7 @@ struct RHash { struct RBasic basic; struct st_table *ntbl; /* possibly 0 */ int iter_lev; - VALUE ifnone; + const VALUE ifnone; }; /* RHASH_TBL allocates st_table if not available. */ #define RHASH_TBL(h) rb_hash_tbl(h) @@ -968,6 +973,7 @@ struct RHash { #define RHASH_IFNONE(h) (RHASH(h)->ifnone) #define RHASH_SIZE(h) (RHASH(h)->ntbl ? RHASH(h)->ntbl->num_entries : 0) #define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0) +#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone) struct RFile { struct RBasic basic; |