Explorar o código

protect against gcc compiler bugs in general

David Rose %!s(int64=15) %!d(string=hai) anos
pai
achega
42a456b2db
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      panda/src/pipeline/asyncTaskBase.cxx

+ 10 - 0
panda/src/pipeline/asyncTaskBase.cxx

@@ -54,8 +54,13 @@ record_task(Thread *current_thread) {
   // If the return value is other than NULL, someone else must have
   // assigned the task first, in another thread.  That shouldn't be
   // possible.
+
+  // But different versions of gcc appear to have problems compiling these
+  // assertions correctly.
+#ifndef __GNUC__
   nassertv(result == NULL);
   nassertv(current_thread->_current_task == this);
+#endif  // __GNUC__
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -75,6 +80,11 @@ clear_task(Thread *current_thread) {
   // If the return value is other than this, someone else must have
   // assigned the task first, in another thread.  That shouldn't be
   // possible.
+
+  // But different versions of gcc appear to have problems compiling these
+  // assertions correctly.
+#ifndef __GNUC__
   nassertv(result == this);
   nassertv(current_thread->_current_task == NULL);
+#endif  // __GNUC__
 }