Make the use of CObjects a conditional compilation flag.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@191 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
44ff6db365
commit
bde299cc9d
1 changed files with 7 additions and 4 deletions
|
|
@ -256,6 +256,7 @@ SWIG_ConvertPtr(PyObject *obj, void **ptr, _swig_type_info *ty) {
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#ifdef SWIG_COBJECT_TYPES
|
||||||
if (!(PyCObject_Check(obj))) {
|
if (!(PyCObject_Check(obj))) {
|
||||||
if (!SWIG_this)
|
if (!SWIG_this)
|
||||||
SWIG_this = PyString_InternFromString("this");
|
SWIG_this = PyString_InternFromString("this");
|
||||||
|
|
@ -265,8 +266,7 @@ SWIG_ConvertPtr(PyObject *obj, void **ptr, _swig_type_info *ty) {
|
||||||
*ptr = PyCObject_AsVoidPtr(obj);
|
*ptr = PyCObject_AsVoidPtr(obj);
|
||||||
c = (char *) PyCObject_GetDesc(obj);
|
c = (char *) PyCObject_GetDesc(obj);
|
||||||
goto cobject;
|
goto cobject;
|
||||||
|
#else
|
||||||
#ifdef SWIG_STRING_TYPES
|
|
||||||
if (!(PyString_Check(obj))) {
|
if (!(PyString_Check(obj))) {
|
||||||
if (!SWIG_this)
|
if (!SWIG_this)
|
||||||
SWIG_this = PyString_InternFromString("this");
|
SWIG_this = PyString_InternFromString("this");
|
||||||
|
|
@ -350,9 +350,12 @@ SWIG_NewPointerObj(void *ptr, _swig_type_info *type) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
/* SWIG_MakePtr(result,ptr,type);
|
#ifdef SWIG_COBJECT_TYPES
|
||||||
robj = PyString_FromString(result);*/
|
|
||||||
robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, type->name, NULL);
|
robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, type->name, NULL);
|
||||||
|
#else
|
||||||
|
SWIG_MakePtr(result,ptr,type);
|
||||||
|
robj = PyString_FromString(result);
|
||||||
|
#endif
|
||||||
return robj;
|
return robj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue