4 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
7 #define RSTRING_PTR(s) (RSTRING(s)->ptr)
10 #define RSTRING_LEN(s) (RSTRING(s)->len)
14 # define SIZEOF_OFF_T 4
15 # warning SIZEOF_OFF_T not defined, guessing 4. Did you run extconf.rb?
19 # define UH_OFF_T_MAX 0x7fffffff
20 #elif SIZEOF_OFF_T == 8
21 # define UH_OFF_T_MAX 0x7fffffffffffffff
23 # error off_t size unknown for this platform!
26 #ifndef HAVE_RB_STR_SET_LEN
27 /* this is taken from Ruby 1.8.7, 1.8.6 may not have it */
28 static void rb_18_str_set_len(VALUE str
, long len
)
30 RSTRING(str
)->len
= len
;
31 RSTRING(str
)->ptr
[len
] = '\0';
33 # define rb_str_set_len(str,len) rb_18_str_set_len(str,len)