Made moo_Py_INCREF and moo_Py_DECREF real functions, always available

master
Yevgen Muntyan 2006-04-09 02:27:43 -05:00
parent 58a319710e
commit c311b57f1c
2 changed files with 25 additions and 2 deletions

View File

@ -28,3 +28,25 @@ moo_python_init (guint version,
moo_py_api = api;
return TRUE;
}
MooPyObject *
moo_Py_INCREF (MooPyObject *obj)
{
g_return_val_if_fail (moo_python_running (), obj);
if (obj)
moo_py_api->incref (obj);
return obj;
}
void
moo_Py_DECREF (MooPyObject *obj)
{
g_return_if_fail (moo_python_running ());
if (obj)
moo_py_api->decref (obj);
}

View File

@ -57,10 +57,11 @@ gboolean moo_python_init (guint version,
MooPyAPI *api);
MooPyObject *moo_Py_INCREF (MooPyObject *obj);
void moo_Py_DECREF (MooPyObject *obj);
#define moo_python_running() (moo_py_api != NULL)
#define moo_Py_INCREF moo_py_api->incref
#define moo_Py_DECREF moo_py_api->decref
#define moo_PyErr_Print moo_py_api->err_print
#define moo_python_get_info moo_py_api->get_info