Skip to content

Commit

Permalink
fixes for swigrun example
Browse files Browse the repository at this point in the history
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7945 626c5289-ae23-0410-ae9c-e8d60b6d4f22
  • Loading branch information
Marcelo Matus committed Dec 7, 2005
1 parent 8b7fb37 commit 6e77a6b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/python/pyapi.swg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ typedef struct swig_const_info {
swig_type_info **ptype;
} swig_const_info;

<<<<<<< pyapi.swg
=======


/* -----------------------------------------------------------------------------
Expand Down Expand Up @@ -75,6 +77,7 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
return result;
}

>>>>>>> 1.13
#ifdef __cplusplus
#if 0
{ /* cc-mode */
Expand Down
41 changes: 41 additions & 0 deletions Lib/python/pyrun.swg
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6e77a6b

Please sign in to comment.