Browse Source

work around gcc 2.96 bug

David Rose 23 years ago
parent
commit
4ed42552db
2 changed files with 13 additions and 3 deletions
  1. 12 0
      panda/src/express/typedObject.cxx
  2. 1 3
      panda/src/express/typedObject.h

+ 12 - 0
panda/src/express/typedObject.cxx

@@ -46,3 +46,15 @@ get_type() const {
     << "TypedObject::get_type() called!\n";
   return _type_handle;
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::init_type
+//       Access: Public, Static
+//  Description: This function is declared non-inline to work around a
+//               compiler bug in g++ 2.96.  Making it inline seems to
+//               cause problems in the optimizer.
+////////////////////////////////////////////////////////////////////
+void TypedObject::
+init_type() {
+  register_type(_type_handle, "TypedObject");
+}

+ 1 - 3
panda/src/express/typedObject.h

@@ -63,9 +63,7 @@ public:
   static TypeHandle get_class_type() {
     return _type_handle;
   }
-  static void init_type() {
-    register_type(_type_handle, "TypedObject");
-  }
+  static void init_type();
 
 private:
   static TypeHandle _type_handle;