Browse Source

fix compiling issues w/o python

David Rose 21 years ago
parent
commit
3fac39f032
3 changed files with 8 additions and 0 deletions
  1. 4 0
      direct/src/dcparser/dcClass.cxx
  2. 2 0
      direct/src/dcparser/dcClass.h
  3. 2 0
      direct/src/dcparser/dcbase.h

+ 4 - 0
direct/src/dcparser/dcClass.cxx

@@ -475,7 +475,9 @@ ai_format_generate(PyObject *distobj, int do_id,
 ////////////////////////////////////////////////////////////////////
 DCClass::
 DCClass(const string &name) : _name(name) {
+#ifdef HAVE_PYTHON
   _class_def = NULL;
+#endif
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -490,7 +492,9 @@ DCClass::
     delete (*fi);
   }
 
+#ifdef HAVE_PYTHON
   Py_XDECREF(_class_def);
+#endif
 }
 
 ////////////////////////////////////////////////////////////////////

+ 2 - 0
direct/src/dcparser/dcClass.h

@@ -90,7 +90,9 @@ private:
   typedef pvector<DCField *> Fields;
   Fields _fields;
 
+#ifdef HAVE_PYTHON
   PyObject *_class_def;
+#endif
 
 public:
   // These members are built up during parsing for the convenience of

+ 2 - 0
direct/src/dcparser/dcbase.h

@@ -75,7 +75,9 @@ using namespace std;
 // Panda defines some assert-type macros.  We map those to the
 // standard assert macro outside of Panda.
 #define nassertr(condition, return_value) assert(condition)
+#define nassertr_always(condition, return_value) assert(condition)
 #define nassertv(condition) assert(condition)
+#define nassertv_always(condition) assert(condition)
 
 // Panda defines these export symbols for building DLL's.  Outside of
 // Panda, we assume we're not putting this code in a DLL, so we define