Fix several issues in modpython.

1. In several cases CString wasn't handled properly.
2. Some container-like object didn't return from functions properly.
3. Buffer.h was missing
This commit is contained in:
Alexey Sokolov
2012-01-02 14:39:17 +07:00
parent 13bfec0809
commit f374874b1a
3 changed files with 32 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ SWIG_AsVal_std_string (PyObject * obj, CString *val)
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,38,%std_string_from@*/
%fragment("SWIG_" "From" "_" {CString},"header",fragment="SWIG_FromCharPtrAndSize") {
%fragment("SWIG_" "From" "_" {CString},"header",fragment="SWIG_FromCharPtrAndSize",fragment="StdTraits") {
SWIGINTERNINLINE PyObject *
SWIG_From_std_string (const CString& s)
{
@@ -82,6 +82,17 @@ SWIG_From_std_string (const CString& s)
}
/*@SWIG@*/
%fragment("StdTraitsCString","header",fragment="SWIG_From_CString") {
namespace swig {
template<> struct traits_from<CString> {
static PyObject *from(const CString& s) {
return SWIG_From_std_string(s);
}
};
}
}
/*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,204,%typemaps_asptrfromn@*/
/*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,193,%typemaps_asptrfrom@*/
/*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,163,%typemaps_asptr@*/
@@ -104,7 +115,7 @@ SWIG_From_std_string (const CString& s)
}
}
/*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,31,%ptr_in_typemap@*/
%typemap(in,fragment="SWIG_" "AsPtr" "_" {CString}) CString {
%typemap(in,fragment="SWIG_" "AsPtr" "_" {CString},fragment="StdTraitsCString") CString {
CString *ptr = (CString *)0;
int res = SWIG_AsPtr_std_string($input, &ptr);
if (!SWIG_IsOK(res) || !ptr) {
@@ -329,4 +340,3 @@ SWIG_From_std_string (const CString& s)
/*@SWIG@*/;