From e2fcd71e0c4773e458ea30059c0f968115c24594 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 29 Mar 2011 20:14:59 +0000 Subject: [PATCH] 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 --- CHANGES.current | 3 +++ Lib/r/rfragments.swg | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 0dbe9348e..9d32aa378 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -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. diff --git a/Lib/r/rfragments.swg b/Lib/r/rfragments.swg index 8a0d85580..afb75c3c1 100644 --- a/Lib/r/rfragments.swg +++ b/Lib/r/rfragments.swg @@ -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;