Ruby: Replace all occurences of STR2CSTR macro with calls to StringValuePtr

STR2CSTR was deprecated in Ruby since years and got finally removed
in Ruby 1.9


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13967 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Klaus Kämpf 2012-12-14 15:48:31 +00:00
commit 23771ef027
8 changed files with 15 additions and 15 deletions

View file

@ -30,7 +30,7 @@
$2 = (char **) malloc((size+1)*sizeof(char *));
VALUE *ptr = RARRAY_PTR($input);
for (i=0; i < size; i++, ptr++) {
$2[i]= STR2CSTR(*ptr);
$2[i]= StringValuePtr(*ptr);
}
$2[i]=NULL;
} else {

View file

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