Changed RREGEXP_SOURCE macro to RREGX_SRC so it matches all rubies

This commit is contained in:
Charles Remes 2010-03-19 09:10:08 -05:00
parent dfe93cb65c
commit b669b625cc

View File

@ -128,17 +128,8 @@ static void write_utf8(buffer_t buffer, VALUE string, char check_null) {
#define INT2STRING(buffer, i) asprintf(buffer, "%d", i); #define INT2STRING(buffer, i) asprintf(buffer, "%d", i);
#endif #endif
/* for rubinius compatibility, use the RREGEXP_SOURCE macro to retrieve #ifndef RREGEXP_SRC
* the regex's source pattern. MRI 1.8 and 1.9 both have RREGEXP_SRC #define RREGEXP_SRC(r) rb_str_new(RREGEXP((r))->str, RREGEXP((r))->len)
* defined, but the underlying structure is different, so the second
* if/else takes care of that.
*/
#ifndef RREGEXP_SOURCE
#ifdef RREGEXP_SRC
#define RREGEXP_SOURCE(r) RREGEXP_SRC(r)
#else
#define RREGEXP_SOURCE(r) rb_str_new(RREGEXP((r))->str, RREGEXP((r))->len)
#endif
#endif #endif
// rubinius compatibility // rubinius compatibility
@ -429,7 +420,7 @@ static int write_element(VALUE key, VALUE value, VALUE extra, int allow_id) {
} }
case T_REGEXP: case T_REGEXP:
{ {
VALUE pattern = RREGEXP_SOURCE(value); VALUE pattern = RREGEXP_SRC(value);
long flags = RREGEXP_OPTIONS(value); long flags = RREGEXP_OPTIONS(value);
VALUE has_extra; VALUE has_extra;