Compile fixes for ruby-1.9.x
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11863 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
830de4d2f1
commit
d64d31a5fa
1 changed files with 3 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ extern int gcd(int x, int y);
|
||||||
if (TYPE($input) != T_ARRAY) {
|
if (TYPE($input) != T_ARRAY) {
|
||||||
SWIG_exception(SWIG_ValueError, "Expected an array");
|
SWIG_exception(SWIG_ValueError, "Expected an array");
|
||||||
}
|
}
|
||||||
$1 = RARRAY($input)->len;
|
$1 = RARRAY_LEN($input);
|
||||||
if ($1 == 0) {
|
if ($1 == 0) {
|
||||||
SWIG_exception(SWIG_ValueError, "List must contain at least 1 element");
|
SWIG_exception(SWIG_ValueError, "List must contain at least 1 element");
|
||||||
}
|
}
|
||||||
|
|
@ -47,7 +47,7 @@ extern int gcdmain(int argc, char *argv[]);
|
||||||
SWIG_exception(SWIG_ValueError, "Expected a string");
|
SWIG_exception(SWIG_ValueError, "Expected a string");
|
||||||
}
|
}
|
||||||
$1 = STR2CSTR($input);
|
$1 = STR2CSTR($input);
|
||||||
$2 = RSTRING($input)->len;
|
$2 = RSTRING_LEN($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int count(char *bytes, int len, char c);
|
extern int count(char *bytes, int len, char c);
|
||||||
|
|
@ -61,7 +61,7 @@ extern int count(char *bytes, int len, char c);
|
||||||
SWIG_exception(SWIG_ValueError,"Expected a string");
|
SWIG_exception(SWIG_ValueError,"Expected a string");
|
||||||
}
|
}
|
||||||
temp = STR2CSTR($input);
|
temp = STR2CSTR($input);
|
||||||
$2 = RSTRING($input)->len;
|
$2 = RSTRING_LEN($input);
|
||||||
$1 = (char *) malloc($2+1);
|
$1 = (char *) malloc($2+1);
|
||||||
memmove($1,temp,$2);
|
memmove($1,temp,$2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue