Add HAVE_PYTHON macro to build without python

This commit is contained in:
Younguk Kim 2017-11-28 13:04:57 +09:00
parent 27f20c80fd
commit 3abf3a0c88
2 changed files with 9 additions and 1 deletions

View File

@ -13,6 +13,8 @@
#include "py_wrappers.h" #include "py_wrappers.h"
#ifdef HAVE_PYTHON
#if PY_VERSION_HEX >= 0x03040000 #if PY_VERSION_HEX >= 0x03040000
#define _COLLECTIONS_ABC "_collections_abc" #define _COLLECTIONS_ABC "_collections_abc"
#elif PY_VERSION_HEX >= 0x03030000 #elif PY_VERSION_HEX >= 0x03030000
@ -1669,3 +1671,5 @@ Dtool_NewStaticProperty(PyTypeObject *type, const PyGetSetDef *getset) {
} }
return (PyObject *)descr; return (PyObject *)descr;
} }
#endif // HAVE_PYTHON

View File

@ -16,6 +16,8 @@
#include "py_panda.h" #include "py_panda.h"
#ifdef HAVE_PYTHON
/** /**
* These classes are returned from properties that require a subscript * These classes are returned from properties that require a subscript
* interface, ie. something.children[i] = 3. * interface, ie. something.children[i] = 3.
@ -71,4 +73,6 @@ EXPCL_INTERROGATEDB Dtool_MappingWrapper *Dtool_NewMutableMappingWrapper(PyObjec
EXPCL_INTERROGATEDB PyObject *Dtool_NewGenerator(PyObject *self, const char *name, iternextfunc func); EXPCL_INTERROGATEDB PyObject *Dtool_NewGenerator(PyObject *self, const char *name, iternextfunc func);
EXPCL_INTERROGATEDB PyObject *Dtool_NewStaticProperty(PyTypeObject *obj, const PyGetSetDef *getset); EXPCL_INTERROGATEDB PyObject *Dtool_NewStaticProperty(PyTypeObject *obj, const PyGetSetDef *getset);
#endif #endif // HAVE_PYTHON
#endif // PY_WRAPPERS_H