fixes for swigrun example

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7945 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-07 23:50:38 +00:00
commit 6e77a6ba25
2 changed files with 44 additions and 0 deletions

View file

@ -27,6 +27,8 @@ typedef struct swig_const_info {
swig_type_info **ptype;
} swig_const_info;
<<<<<<< pyapi.swg
=======
/* -----------------------------------------------------------------------------
@ -75,6 +77,7 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
return result;
}
>>>>>>> 1.13
#ifdef __cplusplus
#if 0
{ /* cc-mode */

View file

@ -78,6 +78,47 @@ extern "C" {
#endif
#endif
/* Safe Py_None and Py_Void accessors */
SWIGRUNTIME PyObject *
SWIG_Py_None(void)
{
static PyObject *none = 0;
if (!none) {
none = Py_BuildValue("");
Py_DECREF(none);
}
return none;
}
SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)
{
PyObject *none = SWIG_Py_None();
Py_INCREF(none);
return none;
}
/* Append a value to the result obj */
SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
if (!result) {
result = obj;
} else if (result == SWIG_Py_None()) {
Py_DECREF(result);
result = obj;
} else {
if (!PyList_Check(result)) {
PyObject *o2 = result;
result = PyList_New(1);
PyList_SetItem(result, 0, o2);
}
PyList_Append(result,obj);
Py_DECREF(obj);
}
return result;
}
/* PySwigClientData */