Created
March 25, 2010 16:24
-
-
Save ptzn/343756 to your computer and use it in GitHub Desktop.
#ifdef RUBY_18 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef RUBY_18 | |
# define STR(x) (RSTRING(x)->ptr) | |
# define LEN(x) (RSTRING(x)->len) | |
# define STR_AUX_CAPA(x) (RSTRING(buf)->aux.capa) | |
# define SET_STR_LEN(x, i) (RSTRING(x)->len = i) | |
# define FLOAT(f) (RFLOAT(f)->value) | |
# define ARRAY(a) (RARRAY(a)->ptr) | |
# define ARRAY_LEN(a) (RARRAY(a)->len) | |
#else | |
# define STR(x) (RSTRING_PTR(x)) | |
# define LEN(x) (RSTRING_LEN(x)) | |
# define STR_AUX_CAPA(x) (RSTRING(buf)->as.heap.aux.capa) | |
# define SET_STR_LEN(x, i) (rb_str_set_len(x, i)) | |
# define FLOAT(f) (RFLOAT_VALUE(f)) | |
# define ARRAY(a) (RARRAY_PTR(a)) | |
# define ARRAY_LEN(a) (RARRAY_LEN(a)) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment