소스 검색

work around gcc 2.96 bug

David Rose 23 년 전
부모
커밋
4ed42552db
2개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  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;