Add some missing SWIGINTERN usage

This commit is contained in:
William S Fulton 2017-01-17 19:58:31 +00:00
commit d9db3cf628
6 changed files with 21 additions and 11 deletions

View file

@ -14,7 +14,8 @@
%{
#include <string>
inline std::string SWIG_scm2string(SCM x) {
SWIGINTERNINLINE
std::string SWIG_scm2string(SCM x) {
char* temp;
temp = SWIG_scm2str(x);
std::string s(temp);

View file

@ -11,10 +11,13 @@
%{
#include <string>
std::string swig_scm_to_string(Scheme_Object* x) {
SWIGINTERNINLINE
std::string swig_scm_to_string(Scheme_Object *x) {
return std::string(SCHEME_STR_VAL(x));
}
Scheme_Object* swig_make_string(const std::string& s) {
SWIGINTERNINLINE
Scheme_Object *swig_make_string(const std::string &s) {
return scheme_make_string(s.c_str());
}
%}

View file

@ -10,10 +10,13 @@
%{
#include <string>
CAML_VALUE SwigString_FromString(const std::string& s) {
return caml_val_string((char *)s.c_str());
}
std::string SwigString_AsString(CAML_VALUE o) {
return std::string((char *)caml_ptr_val(o,0));
}
SWIGINTERNINLINE
CAML_VALUE SwigString_FromString(const std::string &s) {
return caml_val_string((char *)s.c_str());
}
SWIGINTERNINLINE
std::string SwigString_AsString(CAML_VALUE o) {
return std::string((char *)caml_ptr_val(o,0));
}
%}

View file

@ -10,14 +10,17 @@
%fragment("<string>");
%{
SWIGINTERN
double SwigSvToNumber(SV* sv) {
return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv);
}
SWIGINTERN
std::string SwigSvToString(SV* sv) {
STRLEN len;
char *ptr = SvPV(sv, len);
return std::string(ptr, len);
}
SWIGINTERN
void SwigSvFromString(SV* sv, const std::string& s) {
sv_setpvn(sv,s.data(),s.size());
}

View file

@ -18,7 +18,7 @@ SWIG_pchar_descriptor(void)
}
%fragment("SWIG_strnlen","header",fragment="SWIG_FromCharPtrAndSize") {
size_t
SWIGINTERN size_t
SWIG_strnlen(const char* s, size_t maxlen)
{
const char *p;

View file

@ -19,7 +19,7 @@ SWIG_pwchar_descriptor()
}
%fragment("SWIG_wcsnlen","header",fragment="SWIG_FromWCharPtrAndSize") {
size_t
SWIGINTERN size_t
SWIG_wcsnlen(const wchar_t* s, size_t maxlen)
{
const wchar_t *p;