Browse Source

tform: fix MouseWatcher ABI incompatibility with NDEBUG builds

rdb 5 years ago
parent
commit
b05ae1f762
2 changed files with 4 additions and 8 deletions
  1. 4 4
      panda/src/tform/mouseWatcher.cxx
  2. 0 4
      panda/src/tform/mouseWatcher.h

+ 4 - 4
panda/src/tform/mouseWatcher.cxx

@@ -742,7 +742,6 @@ clear_current_regions() {
   }
   }
 }
 }
 
 
-#ifndef NDEBUG
 /**
 /**
  * The protected implementation of show_regions().  This assumes the lock is
  * The protected implementation of show_regions().  This assumes the lock is
  * already held.
  * already held.
@@ -750,6 +749,7 @@ clear_current_regions() {
 void MouseWatcher::
 void MouseWatcher::
 do_show_regions(const NodePath &render2d, const string &bin_name,
 do_show_regions(const NodePath &render2d, const string &bin_name,
                 int draw_order) {
                 int draw_order) {
+#ifndef NDEBUG
   MouseWatcherBase::do_show_regions(render2d, bin_name, draw_order);
   MouseWatcherBase::do_show_regions(render2d, bin_name, draw_order);
   _show_regions_render2d = render2d;
   _show_regions_render2d = render2d;
   _show_regions_bin_name = bin_name;
   _show_regions_bin_name = bin_name;
@@ -758,16 +758,16 @@ do_show_regions(const NodePath &render2d, const string &bin_name,
   for (MouseWatcherGroup *group : _groups) {
   for (MouseWatcherGroup *group : _groups) {
     group->show_regions(render2d, bin_name, draw_order);
     group->show_regions(render2d, bin_name, draw_order);
   }
   }
-}
 #endif  // NDEBUG
 #endif  // NDEBUG
+}
 
 
-#ifndef NDEBUG
 /**
 /**
  * The protected implementation of hide_regions().  This assumes the lock is
  * The protected implementation of hide_regions().  This assumes the lock is
  * already held.
  * already held.
  */
  */
 void MouseWatcher::
 void MouseWatcher::
 do_hide_regions() {
 do_hide_regions() {
+#ifndef NDEBUG
   MouseWatcherBase::do_hide_regions();
   MouseWatcherBase::do_hide_regions();
   _show_regions_render2d = NodePath();
   _show_regions_render2d = NodePath();
   _show_regions_bin_name = string();
   _show_regions_bin_name = string();
@@ -776,8 +776,8 @@ do_hide_regions() {
   for (MouseWatcherGroup *group : _groups) {
   for (MouseWatcherGroup *group : _groups) {
     group->hide_regions();
     group->hide_regions();
   }
   }
-}
 #endif  // NDEBUG
 #endif  // NDEBUG
+}
 
 
 /**
 /**
  * Computes the list of regions that are in both regions_a and regions_b, as
  * Computes the list of regions that are in both regions_a and regions_b, as

+ 0 - 4
panda/src/tform/mouseWatcher.h

@@ -157,11 +157,9 @@ protected:
   void set_current_regions(Regions &regions);
   void set_current_regions(Regions &regions);
   void clear_current_regions();
   void clear_current_regions();
 
 
-#ifndef NDEBUG
   virtual void do_show_regions(const NodePath &render2d,
   virtual void do_show_regions(const NodePath &render2d,
                                const std::string &bin_name, int draw_order);
                                const std::string &bin_name, int draw_order);
   virtual void do_hide_regions();
   virtual void do_hide_regions();
-#endif  // NDEBUG
 
 
   static void intersect_regions(Regions &only_a,
   static void intersect_regions(Regions &only_a,
                                 Regions &only_b,
                                 Regions &only_b,
@@ -260,11 +258,9 @@ private:
   };
   };
   InactivityState _inactivity_state;
   InactivityState _inactivity_state;
 
 
-#ifndef NDEBUG
   NodePath _show_regions_render2d;
   NodePath _show_regions_render2d;
   std::string _show_regions_bin_name;
   std::string _show_regions_bin_name;
   int _show_regions_draw_order;
   int _show_regions_draw_order;
-#endif
 
 
 protected:
 protected:
   // Inherited from DataNode
   // Inherited from DataNode