Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
24d695a7a1
commit
e2fcd71e0c
2 changed files with 6 additions and 3 deletions
|
|
@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Version 2.0.3 (in progress)
|
||||
===========================
|
||||
|
||||
2011-03-29: wsfulton
|
||||
[R] Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0
|
||||
|
||||
2011-03-29: wsfulton
|
||||
[Tcl] Apply patch #3248280 from Christian Delbaere which adds better error messages when
|
||||
the incorrect number or type of arguments are passed to overloaded methods.
|
||||
|
|
|
|||
|
|
@ -170,12 +170,12 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
|
|||
order to allow for use of CHARSXP caches. */
|
||||
|
||||
Rf_protect(t = Rf_allocVector(STRSXP, 1));
|
||||
#if R_VERSION >= R_Version(2,7,0)
|
||||
%#if R_VERSION >= R_Version(2,7,0)
|
||||
c = Rf_mkCharLen(carray, size);
|
||||
#else
|
||||
%#else
|
||||
c = Rf_allocVector(CHARSXP, size);
|
||||
strncpy((char *)CHAR(c), carray, size);
|
||||
#endif
|
||||
%#endif
|
||||
SET_STRING_ELT(t, 0, c);
|
||||
Rf_unprotect(1);
|
||||
return t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue