Skip to content

Commit a666e73

Browse files
registering get_string_buffer
1 parent 2e1bd8e commit a666e73

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

inst/include/Rcpp/internal/wrap.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ template <typename T> class CustomImporter ;
4040

4141
namespace internal{
4242

43-
char* get_string_buffer() ;
44-
4543
inline SEXP make_charsexp__impl__wstring( const wchar_t* data ){
4644
char* buffer = get_string_buffer() ;
4745
wcstombs( buffer, data, MAXELTSIZE ) ;

inst/include/Rcpp/routines.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace Rcpp{
3030
namespace internal{
3131
unsigned long enterRNGScope();
3232
unsigned long exitRNGScope() ;
33+
char* get_string_buffer() ;
3334
}
3435
SEXP get_Rcpp_namespace() ;
3536
SEXP rcpp_get_stack_trace() ;
@@ -100,6 +101,12 @@ namespace Rcpp {
100101
static Fun fun = GET_CALLABLE("exitRNGScope") ;
101102
return fun() ;
102103
}
104+
105+
inline char* get_string_buffer(){
106+
typedef char* (*Fun)(void) ;
107+
static Fun fun = GET_CALLABLE("get_string_buffer") ;
108+
return fun();
109+
}
103110
}
104111

105112
inline SEXP get_Rcpp_namespace() {

src/Rcpp_init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void registerFunctions(){
109109
RCPP_REGISTER(dataptr)
110110
RCPP_REGISTER(getCurrentScope)
111111
RCPP_REGISTER(setCurrentScope)
112+
RCPP_REGISTER(get_string_buffer)
112113
RCPP_REGISTER(mktime00)
113114
RCPP_REGISTER(gmtime_)
114115
#undef RCPP_REGISTER

0 commit comments

Comments
 (0)