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:
parent
2769e15988
commit
a02fee0e9e
1 changed files with 4 additions and 0 deletions
|
|
@ -7,7 +7,11 @@ SWIGINTERN int
|
||||||
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
||||||
{
|
{
|
||||||
if (TYPE(obj) == T_STRING) {
|
if (TYPE(obj) == T_STRING) {
|
||||||
|
#if defined(StringValuePtr)
|
||||||
char *cstr = rb_string_value_ptr(&(obj));
|
char *cstr = rb_string_value_ptr(&(obj));
|
||||||
|
#else
|
||||||
|
char *cstr = STR2CSTR(obj);
|
||||||
|
#endif
|
||||||
size_t size = RSTRING(obj)->len + 1;
|
size_t size = RSTRING(obj)->len + 1;
|
||||||
if (cptr) {
|
if (cptr) {
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue