Support for Ruby 1.6

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8992 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Luigi Ballabio 2006-03-09 08:34:09 +00:00
commit a02fee0e9e

View file

@ -7,7 +7,11 @@ SWIGINTERN int
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
{
if (TYPE(obj) == T_STRING) {
#if defined(StringValuePtr)
char *cstr = rb_string_value_ptr(&(obj));
#else
char *cstr = STR2CSTR(obj);
#endif
size_t size = RSTRING(obj)->len + 1;
if (cptr) {
if (alloc) {