From 3abf3a0c8819c0807cf53bc70be485af9c305761 Mon Sep 17 00:00:00 2001 From: Younguk Kim Date: Tue, 28 Nov 2017 13:04:57 +0900 Subject: [PATCH] Add HAVE_PYTHON macro to build without python --- dtool/src/interrogatedb/py_wrappers.cxx | 4 ++++ dtool/src/interrogatedb/py_wrappers.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/py_wrappers.cxx b/dtool/src/interrogatedb/py_wrappers.cxx index db4e229348..4d56eee41a 100755 --- a/dtool/src/interrogatedb/py_wrappers.cxx +++ b/dtool/src/interrogatedb/py_wrappers.cxx @@ -13,6 +13,8 @@ #include "py_wrappers.h" +#ifdef HAVE_PYTHON + #if PY_VERSION_HEX >= 0x03040000 #define _COLLECTIONS_ABC "_collections_abc" #elif PY_VERSION_HEX >= 0x03030000 @@ -1669,3 +1671,5 @@ Dtool_NewStaticProperty(PyTypeObject *type, const PyGetSetDef *getset) { } return (PyObject *)descr; } + +#endif // HAVE_PYTHON diff --git a/dtool/src/interrogatedb/py_wrappers.h b/dtool/src/interrogatedb/py_wrappers.h index 66f2183299..7bf2c2e19f 100755 --- a/dtool/src/interrogatedb/py_wrappers.h +++ b/dtool/src/interrogatedb/py_wrappers.h @@ -16,6 +16,8 @@ #include "py_panda.h" +#ifdef HAVE_PYTHON + /** * These classes are returned from properties that require a subscript * 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_NewStaticProperty(PyTypeObject *obj, const PyGetSetDef *getset); -#endif +#endif // HAVE_PYTHON + +#endif // PY_WRAPPERS_H