File: ancient_ruby.h

package info (click to toggle)
ruby-kgio 2.11.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 512 kB
  • sloc: ruby: 2,790; ansic: 2,020; sh: 32; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 625 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef MISSING_ANCIENT_RUBY_H
#define MISSING_ANCIENT_RUBY_H

#ifndef HAVE_RB_STR_SET_LEN
static void my_str_set_len(VALUE str, long len)
{
	RSTRING(str)->len = len;
	RSTRING(str)->ptr[len] = '\0';
}
#define rb_str_set_len(str,len) my_str_set_len((str),(len))
#endif /* ! HAVE_RB_STR_SET_LEN */

#ifndef RSTRING_PTR
#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
#endif /* !defined(RSTRING_PTR) */
#ifndef RSTRING_LEN
#  define RSTRING_LEN(s) (RSTRING(s)->len)
#endif /* !defined(RSTRING_LEN) */

#ifndef RARRAY_LEN
#  define RARRAY_LEN(s) (RARRAY(s)->len)
#endif /* !defined(RARRAY_LEN) */

#endif /* MISSING_ANCIENT_RUBY_H */