Browse Source

prevent compiler crash in O4 Irix build

David Rose 24 years ago
parent
commit
8c1c6325f3
2 changed files with 22 additions and 4 deletions
  1. 18 0
      panda/src/pstatclient/pStatCollector.I
  2. 4 4
      panda/src/pstatclient/pStatCollector.h

+ 18 - 0
panda/src/pstatclient/pStatCollector.I

@@ -347,6 +347,24 @@ get_level(const PStatThread &thread) {
 
 
 #else  // DO_PSTATS
 #else  // DO_PSTATS
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: PStatCollector::Constructor
+//       Access: Published
+//  Description: This bogus version of the function is only defined if
+//               DO_PSTATS is not defined, meaning all these functions
+//               should compile to nothing.
+////////////////////////////////////////////////////////////////////
+INLINE PStatCollector::
+PStatCollector(const string &, PStatClient *client) {
+  // We need this bogus comparison just to prevent the SGI compiler
+  // from dumping core.  It's perfectly meaningless.
+#ifdef mips
+  if (client == (PStatClient *)NULL) {
+    return;
+  }
+#endif
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PStatCollector::Constructor
 //     Function: PStatCollector::Constructor
 //       Access: Published
 //       Access: Published

+ 4 - 4
panda/src/pstatclient/pStatCollector.h

@@ -97,10 +97,10 @@ friend class PStatClient;
 
 
 #else  // DO_PSTATS
 #else  // DO_PSTATS
 PUBLISHED:
 PUBLISHED:
-  INLINE PStatCollector(const string &,
-                        PStatClient * = NULL) { }
-  INLINE PStatCollector(const PStatCollector &,
-                        const string &);
+  INLINE PStatCollector(const string &name,
+                        PStatClient *client = NULL);
+  INLINE PStatCollector(const PStatCollector &parent,
+                        const string &name);
 
 
   INLINE bool is_active() { return false; }
   INLINE bool is_active() { return false; }
   INLINE void start() { }
   INLINE void start() { }