summaryrefslogtreecommitdiff
path: root/ruby.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-11 05:24:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-11 05:24:59 +0000
commitcc043890f8cb7c0c057fb076b30765973716c470 (patch)
tree7e7a184bde865a5d67350923fbee84a5ea115f1e /ruby.h
parent076ef717ac48d8093252ed47f9b0591416f339a4 (diff)
* bignum.c (bigdivrem): access boundary bug.
* marshal.c (w_object): prohibit dumping out singleton classes. * object.c (rb_mod_to_s): distinguish singleton classes. * variable.c (rb_class2name): it's ok to reveal NilClass, TrueClass, FalseClass. * eval.c (rb_yield_0): preserve and restore ruby_cref as well. * eval.c (is_defined): core dumped during instance_eval for special constants. * eval.c (rb_eval): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/ruby.h b/ruby.h
index 166bc6e..971a7e0 100644
--- a/ruby.h
+++ b/ruby.h
@@ -186,22 +186,19 @@ void rb_check_type _((VALUE,int));
#define Check_Type(v,t) rb_check_type((VALUE)(v),t)
VALUE rb_str_to_str _((VALUE));
-#define StringValue(v) do {\
- if (TYPE(v) != T_STRING) v = rb_str_to_str(v);\
-} while (0)
+VALUE rb_string_value _((VALUE*));
+
+#define StringValue(v) if (TYPE(v) != T_STRING) rb_string_value(&(v))
void rb_check_safe_str _((VALUE));
-/* obsolete macro - use SafeStringValue(v) */
-#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
#define SafeStringValue(v) do {\
- if (TYPE(v) != T_STRING) v = rb_str_to_str(v);\
+ StringValue(v);\
rb_check_safe_str(v);\
} while (0)
-
-#define StringValuePtr(v) \
- (((TYPE(v) != T_STRING) ? v = rb_str_to_str(v) : (v)), RSTRING(v)->ptr)
+#define StringValuePtr(v) RSTRING((TYPE(v) == T_STRING) ? (v) : rb_string_value(&(v)))->ptr
+/* obsolete macro - use SafeStringValue(v) */
+#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
void rb_secure _((int));
-
EXTERN int ruby_safe_level;
#define rb_safe_level() (ruby_safe_level)
void rb_set_safe_level _((int));