sock_for_fd: drop 1.8/1.9/2.x/3.0-specific hacks
[kgio.git] / ext / kgio / ancient_ruby.h
blobfb0a80b8f489459e8ba7ce90ecf312f11f05b90a
1 #ifndef MISSING_ANCIENT_RUBY_H
2 #define MISSING_ANCIENT_RUBY_H
4 #ifndef HAVE_RB_STR_SET_LEN
5 static void my_str_set_len(VALUE str, long len)
7 RSTRING(str)->len = len;
8 RSTRING(str)->ptr[len] = '\0';
10 #define rb_str_set_len(str,len) my_str_set_len((str),(len))
11 #endif /* ! HAVE_RB_STR_SET_LEN */
13 #ifndef RSTRING_PTR
14 # define RSTRING_PTR(s) (RSTRING(s)->ptr)
15 #endif /* !defined(RSTRING_PTR) */
16 #ifndef RSTRING_LEN
17 # define RSTRING_LEN(s) (RSTRING(s)->len)
18 #endif /* !defined(RSTRING_LEN) */
20 #ifndef RARRAY_LEN
21 # define RARRAY_LEN(s) (RARRAY(s)->len)
22 #endif /* !defined(RARRAY_LEN) */
24 #endif /* MISSING_ANCIENT_RUBY_H */