From 6e8cb98861c28110e065cc4e1709d90f98708a39 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 6 Nov 2018 20:32:37 +0100 Subject: [PATCH] dtoolbase: fix compile errors with --no-python --- dtool/src/dtoolbase/dtoolbase.h | 2 -- dtool/src/dtoolbase/typeHandle.cxx | 2 ++ dtool/src/dtoolbase/typeHandle.h | 2 ++ dtool/src/dtoolbase/typeRegistry.cxx | 2 ++ dtool/src/dtoolbase/typeRegistry.h | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 2f8e7ca05d..66142427cc 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -138,12 +138,10 @@ #endif #endif -#ifdef HAVE_PYTHON // Instead of including the Python headers, which will implicitly add a linker // flag to link in Python, we'll just excerpt the forward declaration of // PyObject. typedef struct _object PyObject; -#endif #ifndef HAVE_EIGEN // If we don't have the Eigen library, don't define LINMATH_ALIGN. diff --git a/dtool/src/dtoolbase/typeHandle.cxx b/dtool/src/dtoolbase/typeHandle.cxx index 30d499bf01..c72c3f9d99 100644 --- a/dtool/src/dtoolbase/typeHandle.cxx +++ b/dtool/src/dtoolbase/typeHandle.cxx @@ -153,6 +153,7 @@ deallocate_array(void *ptr) { PANDA_FREE_ARRAY(ptr); } +#ifdef HAVE_PYTHON /** * Returns the internal void pointer that is stored for interrogate's benefit. */ @@ -165,6 +166,7 @@ get_python_type() const { return nullptr; } } +#endif /** * Return the Index of the BEst fit Classs from a set diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index ed5ab3f586..094d4abf4a 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -138,7 +138,9 @@ PUBLISHED: MAKE_SEQ_PROPERTY(child_classes, get_num_child_classes, get_child_class); public: +#ifdef HAVE_PYTHON PyObject *get_python_type() const; +#endif void *allocate_array(size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT); void *reallocate_array(void *ptr, size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT); diff --git a/dtool/src/dtoolbase/typeRegistry.cxx b/dtool/src/dtoolbase/typeRegistry.cxx index d18ca61244..360dfcd9e4 100644 --- a/dtool/src/dtoolbase/typeRegistry.cxx +++ b/dtool/src/dtoolbase/typeRegistry.cxx @@ -207,6 +207,7 @@ record_alternate_name(TypeHandle type, const string &name) { _lock->unlock(); } +#ifdef HAVE_PYTHON /** * Records the given Python type pointer in the type registry for the benefit * of interrogate. @@ -222,6 +223,7 @@ record_python_type(TypeHandle type, PyObject *python_type) { _lock->unlock(); } +#endif /** * Looks for a previously-registered type of the given name. Returns its diff --git a/dtool/src/dtoolbase/typeRegistry.h b/dtool/src/dtoolbase/typeRegistry.h index 4a6bd5d1e0..43b1b8e41f 100644 --- a/dtool/src/dtoolbase/typeRegistry.h +++ b/dtool/src/dtoolbase/typeRegistry.h @@ -45,7 +45,9 @@ PUBLISHED: void record_derivation(TypeHandle child, TypeHandle parent); void record_alternate_name(TypeHandle type, const std::string &name); +#ifdef HAVE_PYTHON void record_python_type(TypeHandle type, PyObject *python_type); +#endif TypeHandle find_type(const std::string &name) const; TypeHandle find_type_by_id(int id) const;