Browse Source

Merge branch 'cmake' of https://github.com/panda3d/panda3d into cmake

Donny Lawrence 7 years ago
parent
commit
a270b0f292
100 changed files with 428 additions and 837 deletions
  1. 1 1
      cmake/macros/CompositeSources.cmake
  2. 3 0
      contrib/src/ai/aiCharacter.cxx
  3. 2 1
      contrib/src/ai/aiCharacter.h
  4. 29 101
      contrib/src/ai/aiWorld.cxx
  5. 2 22
      contrib/src/ai/aiWorld.h
  6. 1 1
      contrib/src/ai/flock.h
  7. 15 10
      direct/src/showbase/Audio3DManager.py
  8. 23 4
      direct/src/stdpy/glob.py
  9. 1 13
      dtool/LocalSetup.cmake
  10. 0 28
      dtool/Package.cmake
  11. 10 0
      dtool/PandaVersion.cmake
  12. 1 1
      dtool/dtool_config.h.in
  13. 7 0
      dtool/src/dtoolbase/CMakeLists.txt
  14. 5 2
      dtool/src/dtoolbase/atomicAdjustDummyImpl.I
  15. 1 1
      dtool/src/dtoolbase/atomicAdjustDummyImpl.h
  16. 3 2
      dtool/src/dtoolbase/atomicAdjustGccImpl.I
  17. 1 1
      dtool/src/dtoolbase/atomicAdjustGccImpl.h
  18. 6 2
      dtool/src/dtoolbase/atomicAdjustI386Impl.I
  19. 1 1
      dtool/src/dtoolbase/atomicAdjustI386Impl.h
  20. 5 2
      dtool/src/dtoolbase/atomicAdjustPosixImpl.I
  21. 1 1
      dtool/src/dtoolbase/atomicAdjustPosixImpl.h
  22. 8 4
      dtool/src/dtoolbase/atomicAdjustWin32Impl.I
  23. 1 1
      dtool/src/dtoolbase/atomicAdjustWin32Impl.h
  24. 1 1
      dtool/src/dtoolbase/checkPandaVersion.h.in
  25. 5 5
      dtool/src/dtoolbase/deletedBufferChain.cxx
  26. 22 126
      dtool/src/dtoolbase/dtoolbase_cc.h
  27. 0 2
      dtool/src/dtoolbase/fakestringstream.h
  28. 0 9
      dtool/src/dtoolbase/memoryHook.I
  29. 22 22
      dtool/src/dtoolbase/memoryHook.cxx
  30. 3 1
      dtool/src/dtoolbase/memoryHook.h
  31. 3 3
      dtool/src/dtoolbase/mutexDummyImpl.I
  32. 6 7
      dtool/src/dtoolbase/mutexDummyImpl.h
  33. 16 32
      dtool/src/dtoolbase/mutexPosixImpl.I
  34. 12 18
      dtool/src/dtoolbase/mutexPosixImpl.h
  35. 5 5
      dtool/src/dtoolbase/mutexSpinlockImpl.I
  36. 6 7
      dtool/src/dtoolbase/mutexSpinlockImpl.h
  37. 3 3
      dtool/src/dtoolbase/mutexWin32Impl.I
  38. 5 6
      dtool/src/dtoolbase/mutexWin32Impl.h
  39. 3 3
      dtool/src/dtoolbase/nearly_zero.h
  40. 2 2
      dtool/src/dtoolbase/neverFreeMemory.I
  41. 3 3
      dtool/src/dtoolbase/neverFreeMemory.cxx
  42. 2 2
      dtool/src/dtoolbase/pallocator.T
  43. 4 4
      dtool/src/dtoolbase/pallocator.h
  44. 4 0
      dtool/src/dtoolbase/pandaVersion.h.in
  45. 6 9
      dtool/src/dtoolbase/pvector.h
  46. 1 20
      dtool/src/dtoolbase/typeHandle.I
  47. 5 5
      dtool/src/dtoolbase/typeHandle.h
  48. 44 44
      dtool/src/dtoolbase/typeRegistry.cxx
  49. 3 3
      dtool/src/dtoolbase/typedObject.h
  50. 8 17
      dtool/src/dtoolutil/filename.I
  51. 3 3
      dtool/src/dtoolutil/filename.cxx
  52. 4 10
      dtool/src/dtoolutil/filename.h
  53. 0 2
      dtool/src/interrogate/interfaceMakerPythonNative.cxx
  54. 2 2
      dtool/src/prc/configVariableFilename.cxx
  55. 2 2
      dtool/src/prc/configVariableString.cxx
  56. 2 2
      dtool/src/prc/notifyCategory.I
  57. 2 2
      dtool/src/prc/notifyCategory.h
  58. 2 2
      dtool/src/prc/notifyCategoryProxy.I
  59. 2 2
      dtool/src/prc/notifyCategoryProxy.h
  60. 2 2
      dtool/src/prc/streamWrapper.I
  61. 1 3
      dtool/src/prc/streamWrapper.h
  62. 18 22
      makepanda/makepanda.py
  63. 0 6
      panda/metalibs/panda/panda.cxx
  64. 0 6
      panda/metalibs/pandabullet/pandabullet.cxx
  65. 0 6
      panda/metalibs/pandadx9/pandadx9.cxx
  66. 0 6
      panda/metalibs/pandaegg/pandaegg.cxx
  67. 0 6
      panda/metalibs/pandaegg/pandaeggnopg.cxx
  68. 0 6
      panda/metalibs/pandaexpress/pandaexpress.cxx
  69. 0 6
      panda/metalibs/pandafx/pandafx.cxx
  70. 0 6
      panda/metalibs/pandagl/pandagl.cxx
  71. 0 6
      panda/metalibs/pandagles/pandagles.cxx
  72. 0 6
      panda/metalibs/pandagles2/pandagles2.cxx
  73. 0 6
      panda/metalibs/pandaode/pandaode.cxx
  74. 0 6
      panda/metalibs/pandaphysics/pandaphysics.cxx
  75. 0 6
      panda/metalibs/pandaphysx/pandaphysx.cxx
  76. 0 6
      panda/src/android/pview.cxx
  77. 1 1
      panda/src/bullet/bulletSoftBodyNode.cxx
  78. 1 1
      panda/src/bullet/bulletTriangleMesh.h
  79. 1 1
      panda/src/chan/partBundle.cxx
  80. 6 6
      panda/src/char/characterJoint.cxx
  81. 12 6
      panda/src/char/characterJointEffect.I
  82. 9 11
      panda/src/char/characterJointEffect.cxx
  83. 3 1
      panda/src/char/characterJointEffect.h
  84. 0 21
      panda/src/display/displayRegion.I
  85. 0 19
      panda/src/display/displayRegion.cxx
  86. 4 7
      panda/src/display/displayRegion.h
  87. 0 16
      panda/src/display/graphicsDevice.cxx
  88. 2 4
      panda/src/display/graphicsDevice.h
  89. 1 1
      panda/src/display/graphicsEngine.cxx
  90. 0 19
      panda/src/display/graphicsOutput.cxx
  91. 2 4
      panda/src/display/graphicsOutput.h
  92. 2 3
      panda/src/display/graphicsPipe.h
  93. 1 1
      panda/src/display/graphicsStateGuardian.h
  94. 8 8
      panda/src/downloader/multiplexStreamBuf.cxx
  95. 4 4
      panda/src/downloader/virtualFileMountHTTP.cxx
  96. 2 2
      panda/src/dxgsg9/dxGeomMunger9.I
  97. 3 0
      panda/src/dxgsg9/dxGeomMunger9.cxx
  98. 2 2
      panda/src/event/asyncFuture.cxx
  99. 1 1
      panda/src/event/asyncFuture.h
  100. 2 2
      panda/src/event/asyncTask.cxx

+ 1 - 1
cmake/macros/CompositeSources.cmake

@@ -93,7 +93,7 @@ function(composite_sources target sources_var)
     endif()
     endif()
   endwhile()
   endwhile()
 
 
-  #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES)
+  set_source_files_properties(${composite_files} PROPERTIES GENERATED YES)
 
 
   # The new files are added to the existing files, which means the old files
   # The new files are added to the existing files, which means the old files
   # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting.
   # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting.

+ 3 - 0
contrib/src/ai/aiCharacter.cxx

@@ -24,6 +24,8 @@ AICharacter::AICharacter(string model_name, NodePath model_np, double mass, doub
   _velocity = LVecBase3(0.0, 0.0, 0.0);
   _velocity = LVecBase3(0.0, 0.0, 0.0);
   _steering_force = LVecBase3(0.0, 0.0, 0.0);
   _steering_force = LVecBase3(0.0, 0.0, 0.0);
 
 
+  _world = nullptr;
+
   _steering = new AIBehaviors();
   _steering = new AIBehaviors();
   _steering->_ai_char = this;
   _steering->_ai_char = this;
 
 
@@ -31,6 +33,7 @@ AICharacter::AICharacter(string model_name, NodePath model_np, double mass, doub
 }
 }
 
 
 AICharacter::~AICharacter() {
 AICharacter::~AICharacter() {
+  nassertv(_world == nullptr);
 }
 }
 
 
 /**
 /**

+ 2 - 1
contrib/src/ai/aiCharacter.h

@@ -15,6 +15,7 @@
 #define _AICHARACTER_H
 #define _AICHARACTER_H
 
 
 #include "aiBehaviors.h"
 #include "aiBehaviors.h"
+#include "referenceCount.h"
 
 
 /**
 /**
  * This class is used for creating the AI characters.  It assigns both physics
  * This class is used for creating the AI characters.  It assigns both physics
@@ -25,7 +26,7 @@
 class AIBehaviors;
 class AIBehaviors;
 class AIWorld;
 class AIWorld;
 
 
-class EXPCL_PANDAAI AICharacter {
+class EXPCL_PANDAAI AICharacter : public ReferenceCount {
  public:
  public:
   double _mass;
   double _mass;
   double _max_force;
   double _max_force;

+ 29 - 101
contrib/src/ai/aiWorld.cxx

@@ -14,44 +14,56 @@
 #include "aiWorld.h"
 #include "aiWorld.h"
 
 
 AIWorld::AIWorld(NodePath render) {
 AIWorld::AIWorld(NodePath render) {
-  _ai_char_pool = new AICharPool();
-  _render = render;
+  _render = move(render);
 }
 }
 
 
 AIWorld::~AIWorld() {
 AIWorld::~AIWorld() {
 }
 }
 
 
 void AIWorld::add_ai_char(AICharacter *ai_char) {
 void AIWorld::add_ai_char(AICharacter *ai_char) {
-  _ai_char_pool->append(ai_char);
+  _ai_char_pool.push_back(ai_char);
   ai_char->_window_render = _render;
   ai_char->_window_render = _render;
   ai_char->_world = this;
   ai_char->_world = this;
 }
 }
 
 
 void AIWorld::remove_ai_char(string name) {
 void AIWorld::remove_ai_char(string name) {
-  _ai_char_pool->del(name);
-  remove_ai_char_from_flock(name);
+  AICharPool::iterator it;
+  for (it = _ai_char_pool.begin(); it != _ai_char_pool.end(); ++it) {
+    AICharacter *ai_char = *it;
+    if (ai_char->_name == name) {
+      nassertv(ai_char->_world == this);
+      ai_char->_world = nullptr;
+      _ai_char_pool.erase(it);
+      break;
+    }
+  }
+
+  remove_ai_char_from_flock(move(name));
 }
 }
 
 
 void AIWorld::remove_ai_char_from_flock(string name) {
 void AIWorld::remove_ai_char_from_flock(string name) {
-  AICharPool::node *ai_pool;
-  ai_pool = _ai_char_pool->_head;
-  while((ai_pool) != NULL) {
-    for(unsigned int i = 0; i < _flock_pool.size(); ++i) {
-      if(ai_pool->_ai_char->_ai_char_flock_id == _flock_pool[i]->get_id()) {
-        for(unsigned int j = 0; j<_flock_pool[i]->_ai_char_list.size(); ++j) {
-          if(_flock_pool[i]->_ai_char_list[j]->_name == name) {
-            _flock_pool[i]->_ai_char_list.erase(_flock_pool[i]->_ai_char_list.begin() + j);
+  for (AICharacter *ai_char : _ai_char_pool) {
+    for (Flock *flock : _flock_pool) {
+      if (ai_char->_ai_char_flock_id == flock->get_id()) {
+        for (size_t j = 0; j < flock->_ai_char_list.size(); ++j) {
+          if (flock->_ai_char_list[j]->_name == name) {
+            flock->_ai_char_list.erase(flock->_ai_char_list.begin() + j);
             return;
             return;
           }
           }
         }
         }
       }
       }
     }
     }
-    ai_pool = ai_pool->_next;
   }
   }
 }
 }
 
 
+/**
+ * This function prints the names of the AI characters that have been added to
+ * the AIWorld.  Useful for debugging purposes.
+ */
 void AIWorld::print_list() {
 void AIWorld::print_list() {
-  _ai_char_pool->print_list();
+  for (AICharacter *ai_char : _ai_char_pool) {
+    cout << ai_char->_name << endl;
+  }
 }
 }
 
 
 /**
 /**
@@ -59,12 +71,8 @@ void AIWorld::print_list() {
  * characters which have been added to the AIWorld.
  * characters which have been added to the AIWorld.
  */
  */
 void AIWorld::update() {
 void AIWorld::update() {
-  AICharPool::node *ai_pool;
-  ai_pool = _ai_char_pool->_head;
-
-  while((ai_pool)!=NULL) {
-    ai_pool->_ai_char->update();
-    ai_pool = ai_pool->_next;
+  for (AICharacter *ai_char : _ai_char_pool) {
+    ai_char->update();
   }
   }
 }
 }
 
 
@@ -142,86 +150,6 @@ void AIWorld::flock_on(unsigned int flock_id) {
   }
   }
 }
 }
 
 
-AICharPool::AICharPool() {
-  _head = NULL;
-}
-
-AICharPool::~AICharPool() {
-}
-
-void AICharPool::append(AICharacter *ai_ch) {
-  node *q;
-  node *t;
-
-  if(_head == NULL) {
-    q = new node();
-    q->_ai_char = ai_ch;
-    q->_next = NULL;
-    _head = q;
-  }
-  else {
-    q = _head;
-    while( q->_next != NULL) {
-      q = q->_next;
-    }
-
-    t = new node();
-    t->_ai_char = ai_ch;
-    t->_next = NULL;
-    q->_next = t;
-  }
-}
-
-void AICharPool::del(string name) {
-  node *q;
-  node *r;
-  q = _head;
-
-  if(_head==NULL) {
-    return;
-  }
-
-  // Only one node in the linked list
-  if(q->_next == NULL) {
-    if(q->_ai_char->_name == name) {
-      _head = NULL;
-      delete q;
-    }
-    return;
-  }
-
-  r = q;
-  while( q != NULL) {
-    if( q->_ai_char->_name == name) {
-      // Special case
-      if(q == _head) {
-        _head = q->_next;
-        delete q;
-        return;
-      }
-
-      r->_next = q->_next;
-      delete q;
-      return;
-    }
-    r = q;
-    q = q->_next;
-  }
-}
-
-/**
- * This function prints the ai characters in the AICharPool.  Used for
- * debugging purposes.
- */
-void AICharPool::print_list() {
-  node* q;
-  q = _head;
-  while(q != NULL) {
-    cout<<q->_ai_char->_name<<endl;
-    q = q->_next;
-  }
-}
-
 /**
 /**
  * This function adds the nodepath as an obstacle that is needed by the
  * This function adds the nodepath as an obstacle that is needed by the
  * obstacle avoidance behavior.
  * obstacle avoidance behavior.

+ 2 - 22
contrib/src/ai/aiWorld.h

@@ -21,27 +21,6 @@
 class AICharacter;
 class AICharacter;
 class Flock;
 class Flock;
 
 
-/**
- * This class implements a linked list of AI Characters allowing the user to
- * add and delete characters from the linked list.  This will be used in the
- * AIWorld class.
- */
-class EXPCL_PANDAAI AICharPool {
-    public:
-    struct node {
-      AICharacter * _ai_char;
-      node * _next;
-    } ;
-
-    node* _head;
-    AICharPool();
-    ~AICharPool();
-    void append(AICharacter *ai_ch);
-    void del(string name);
-        void print_list();
-};
-
-
 /**
 /**
  * A class that implements the virtual AI world which keeps track of the AI
  * A class that implements the virtual AI world which keeps track of the AI
  * characters active at any given time.  It contains a linked list of AI
  * characters active at any given time.  It contains a linked list of AI
@@ -51,7 +30,8 @@ class EXPCL_PANDAAI AICharPool {
  */
  */
 class EXPCL_PANDAAI AIWorld {
 class EXPCL_PANDAAI AIWorld {
   private:
   private:
-    AICharPool * _ai_char_pool;
+    typedef std::vector<PT(AICharacter)> AICharPool;
+    AICharPool _ai_char_pool;
     NodePath _render;
     NodePath _render;
   public:
   public:
     vector<NodePath> _obstacles;
     vector<NodePath> _obstacles;

+ 1 - 1
contrib/src/ai/flock.h

@@ -40,7 +40,7 @@ public:
   unsigned int _alignment_wt;
   unsigned int _alignment_wt;
 
 
   // This vector will hold all the ai characters which belong to this flock.
   // This vector will hold all the ai characters which belong to this flock.
-  typedef std::vector<AICharacter*> AICharList;
+  typedef std::vector<PT(AICharacter)> AICharList;
   AICharList _ai_char_list;
   AICharList _ai_char_list;
 
 
 PUBLISHED:
 PUBLISHED:

+ 15 - 10
direct/src/showbase/Audio3DManager.py

@@ -2,8 +2,8 @@
 
 
 __all__ = ['Audio3DManager']
 __all__ = ['Audio3DManager']
 
 
-from panda3d.core import Vec3, VBase3
-from direct.task import Task
+from panda3d.core import Vec3, VBase3, WeakNodePath
+from direct.task.TaskManagerGlobal import Task, taskMgr
 #
 #
 class Audio3DManager:
 class Audio3DManager:
 
 
@@ -181,7 +181,8 @@ class Audio3DManager:
 
 
     def attachSoundToObject(self, sound, object):
     def attachSoundToObject(self, sound, object):
         """
         """
-        Sound will come from the location of the object it is attached to
+        Sound will come from the location of the object it is attached to.
+        If the object is deleted, the sound will automatically be removed.
         """
         """
         # sound is an AudioSound
         # sound is an AudioSound
         # object is any Panda object with coordinates
         # object is any Panda object with coordinates
@@ -197,7 +198,7 @@ class Audio3DManager:
                     del self.sound_dict[known_object]
                     del self.sound_dict[known_object]
 
 
         if object not in self.sound_dict:
         if object not in self.sound_dict:
-            self.sound_dict[object] = []
+            self.sound_dict[WeakNodePath(object)] = []
 
 
         self.sound_dict[object].append(sound)
         self.sound_dict[object].append(sound)
         return 1
         return 1
@@ -258,14 +259,18 @@ class Audio3DManager:
             if self.audio_manager.getActive()==0:
             if self.audio_manager.getActive()==0:
                 return Task.cont
                 return Task.cont
 
 
-        for known_object in list(self.sound_dict.keys()):
-            tracked_sound = 0
-            while tracked_sound < len(self.sound_dict[known_object]):
-                sound = self.sound_dict[known_object][tracked_sound]
-                pos = known_object.getPos(self.root)
+        for known_object, sounds in list(self.sound_dict.items()):
+            node_path = known_object.getNodePath()
+            if not node_path:
+                # The node has been deleted.
+                del self.sound_dict[known_object]
+                continue
+
+            pos = node_path.getPos(self.root)
+
+            for sound in sounds:
                 vel = self.getSoundVelocity(sound)
                 vel = self.getSoundVelocity(sound)
                 sound.set3dAttributes(pos[0], pos[1], pos[2], vel[0], vel[1], vel[2])
                 sound.set3dAttributes(pos[0], pos[1], pos[2], vel[0], vel[1], vel[2])
-                tracked_sound += 1
 
 
         # Update the position of the listener based on the object
         # Update the position of the listener based on the object
         # to which it is attached
         # to which it is attached

+ 23 - 4
direct/src/stdpy/glob.py

@@ -4,7 +4,6 @@ virtual file system. """
 
 
 import sys
 import sys
 import os
 import os
-import re
 import fnmatch
 import fnmatch
 
 
 from direct.stdpy import file
 from direct.stdpy import file
@@ -76,7 +75,27 @@ def glob0(dirname, basename):
     return []
     return []
 
 
 
 
-magic_check = re.compile('[*?[]')
-
 def has_magic(s):
 def has_magic(s):
-    return magic_check.search(s) is not None
+    if isinstance(s, bytes):
+        return b'*' in s or b'?' in s or b'[' in s
+    else:
+        return '*' in s or '?' in s or '[' in s
+
+def escape(pathname):
+    drive, pathname = os.path.splitdrive(pathname)
+    if sys.version_info >= (3, 0) and isinstance(pathname, bytes):
+        newpath = bytearray(drive)
+        for c in pathname:
+            if c == 42 or c == 63 or c == 91:
+                newpath += bytes((91, c, 93))
+            else:
+                newpath.append(c)
+        return bytes(newpath)
+    else:
+        newpath = drive
+        for c in pathname:
+            if c == '*' or c == '?' or c == '[':
+                newpath += '[' + c + ']'
+            else:
+                newpath += c
+        return newpath

+ 1 - 13
dtool/LocalSetup.cmake

@@ -34,7 +34,7 @@ int main(int argc, char *argv[]) { fs.open(\"file\", std::fstream::out, 0644); r
 check_cxx_source_compiles("
 check_cxx_source_compiles("
 #include <unistd.h>
 #include <unistd.h>
 int main(int argc, char *argv[]) { lockf(0, F_LOCK, 0); return 0; }
 int main(int argc, char *argv[]) { lockf(0, F_LOCK, 0); return 0; }
-" HAVE_LOCKF)
+" PHAVE_LOCKF)
 
 
 # Check if we have a wchar_t type.
 # Check if we have a wchar_t type.
 check_type_size(wchar_t HAVE_WCHAR_T)
 check_type_size(wchar_t HAVE_WCHAR_T)
@@ -206,18 +206,6 @@ else()
   message("- Did not find gtk+-2")
   message("- Did not find gtk+-2")
 endif()
 endif()
 
 
-if(HAVE_WX)
-  message("+ WxWidgets")
-else()
-  message("- Did not find WxWidgets")
-endif()
-
-if(HAVE_FLTK)
-  message("+ FLTK")
-else()
-  message("- Did not find FLTK")
-endif()
-
 if(HAVE_GL)
 if(HAVE_GL)
   message("+ OpenGL")
   message("+ OpenGL")
 else()
 else()

+ 0 - 28
dtool/Package.cmake

@@ -257,34 +257,6 @@ package_option(PhysX
 
 
 config_package(PhysX "Nvidia PhysX")
 config_package(PhysX "Nvidia PhysX")
 
 
-# Find and configure WxWidgets
-find_package(wxWidgets QUIET)
-if(WXWIDGETS_FOUND)
-  set(WX_FOUND TRUE) # Mangle for convenience
-endif()
-# Cleanup after builtin FindWx
-mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE)
-mark_as_advanced(wxWidgets_wxrc_EXECUTABLE)
-#config_package(WX "WxWidgets")
-package_option(WX)
-
-# Find and configure FLTK
-set(OpenGL_FIND_QUIETLY TRUE) # Fix for builtin FindFLTK
-find_package(FLTK QUIET)
-mark_as_advanced(FLTK_BASE_LIBRARY) # Cleanup after builtin FLTK
-mark_as_advanced(FLTK_CONFIG_SCRIPT) # Cleanup after builtin FLTK
-mark_as_advanced(FLTK_FLUID_EXECUTABLE) # Cleanup after builtin FLTK
-mark_as_advanced(FLTK_FORMS_LIBRARY) # Cleanup after builtin FLTK
-mark_as_advanced(FLTK_GL_LIBRARY) # Cleanup after builtin FLTK
-mark_as_advanced(FLTK_IMAGES_LIBRARY) # Cleanup after builtin FLTK
-mark_as_advanced(FLTK_INCLUDE_DIR) # Cleanup after builtin FLTK
-#config_package(FLTK)
-package_option(FLTK)
-
-# Cleanup after builtin FindFLTK
-mark_as_advanced(FLTK_DIR)
-mark_as_advanced(FLTK_MATH_LIBRARY)
-
 
 
 ########
 ########
 # TODO #
 # TODO #

+ 10 - 0
dtool/PandaVersion.cmake

@@ -73,6 +73,16 @@ set(PANDA_VERSION_SYMBOL panda_version_${PROJECT_VERSION_MAJOR}_${PROJECT_VERSIO
 # for each component.
 # for each component.
 math(EXPR PANDA_NUMERIC_VERSION "${PROJECT_VERSION_MAJOR}*1000000 + ${PROJECT_VERSION_MINOR}*1000 + ${PROJECT_VERSION_PATCH}")
 math(EXPR PANDA_NUMERIC_VERSION "${PROJECT_VERSION_MAJOR}*1000000 + ${PROJECT_VERSION_MINOR}*1000 + ${PROJECT_VERSION_PATCH}")
 
 
+# The Panda Git SHA1 refspec, for PandaSystem::get_git_commit()
+find_package(Git QUIET)
+if(GIT_EXECUTABLE)
+  execute_process(
+    COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
+    WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+    OUTPUT_VARIABLE PANDA_GIT_COMMIT_STR
+    ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+
 # Separate the plugin version into its three components.
 # Separate the plugin version into its three components.
 string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}")
 string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}")
 list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION)
 list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION)

+ 1 - 1
dtool/dtool_config.h.in

@@ -265,7 +265,7 @@
 #cmakedefine HAVE_OPEN_MASK
 #cmakedefine HAVE_OPEN_MASK
 
 
 /* Define if we have a lockf() function. */
 /* Define if we have a lockf() function. */
-#cmakedefine HAVE_LOCKF
+#cmakedefine PHAVE_LOCKF
 
 
 /* Define if some header file defines wchar_t. */
 /* Define if some header file defines wchar_t. */
 #cmakedefine HAVE_WCHAR_T
 #cmakedefine HAVE_WCHAR_T

+ 7 - 0
dtool/src/dtoolbase/CMakeLists.txt

@@ -2,6 +2,13 @@ configure_file(pandaVersion.h.in pandaVersion.h)
 configure_file(checkPandaVersion.h.in checkPandaVersion.h)
 configure_file(checkPandaVersion.h.in checkPandaVersion.h)
 configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx)
 configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx)
 
 
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 17)
+  # This serves as a reminder to update checkPandaVersion.h.in when we upgrade
+  # to C++17, which supports inline variables - a cleaner way of depending on
+  # the Panda version symbol from a header than what we're currently doing.
+  message(FATAL_ERROR "Developer notice: Update checkPandaVersion.h.in for C++17!")
+endif()
+
 set(P3DTOOLBASE_HEADERS
 set(P3DTOOLBASE_HEADERS
     ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h
     ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h
     ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h
     ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h

+ 5 - 2
dtool/src/dtoolbase/atomicAdjustDummyImpl.I

@@ -30,10 +30,13 @@ dec(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
 
 
 /**
 /**
  * Atomically computes var += delta.  It is legal for delta to be negative.
  * Atomically computes var += delta.  It is legal for delta to be negative.
+ * Returns the result of the addition.
  */
  */
-ALWAYS_INLINE void AtomicAdjustDummyImpl::
+ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
 add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer delta) {
 add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer delta) {
-  var += delta;
+  Integer new_value = var + delta;
+  var = new_value;
+  return new_value;
 }
 }
 
 
 /**
 /**

+ 1 - 1
dtool/src/dtoolbase/atomicAdjustDummyImpl.h

@@ -31,7 +31,7 @@ public:
 
 
   ALWAYS_INLINE static void inc(TVOLATILE Integer &var);
   ALWAYS_INLINE static void inc(TVOLATILE Integer &var);
   ALWAYS_INLINE static bool dec(TVOLATILE Integer &var);
   ALWAYS_INLINE static bool dec(TVOLATILE Integer &var);
-  ALWAYS_INLINE static void add(TVOLATILE Integer &var, Integer delta);
+  ALWAYS_INLINE static Integer add(TVOLATILE Integer &var, Integer delta);
   ALWAYS_INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   ALWAYS_INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   ALWAYS_INLINE static Integer get(const TVOLATILE Integer &var);
   ALWAYS_INLINE static Integer get(const TVOLATILE Integer &var);
 
 

+ 3 - 2
dtool/src/dtoolbase/atomicAdjustGccImpl.I

@@ -30,11 +30,12 @@ dec(TVOLATILE AtomicAdjustGccImpl::Integer &var) {
 
 
 /**
 /**
  * Atomically computes var += delta.  It is legal for delta to be negative.
  * Atomically computes var += delta.  It is legal for delta to be negative.
+ * Returns the result of the addition.
  */
  */
-INLINE void AtomicAdjustGccImpl::
+INLINE AtomicAdjustGccImpl::Integer AtomicAdjustGccImpl::
 add(TVOLATILE AtomicAdjustGccImpl::Integer &var,
 add(TVOLATILE AtomicAdjustGccImpl::Integer &var,
     AtomicAdjustGccImpl::Integer delta) {
     AtomicAdjustGccImpl::Integer delta) {
-  __atomic_fetch_add(&var, delta, __ATOMIC_SEQ_CST);
+  return __atomic_add_fetch(&var, delta, __ATOMIC_SEQ_CST);
 }
 }
 
 
 /**
 /**

+ 1 - 1
dtool/src/dtoolbase/atomicAdjustGccImpl.h

@@ -35,7 +35,7 @@ public:
 
 
   INLINE static void inc(TVOLATILE Integer &var);
   INLINE static void inc(TVOLATILE Integer &var);
   INLINE static bool dec(TVOLATILE Integer &var);
   INLINE static bool dec(TVOLATILE Integer &var);
-  INLINE static void add(TVOLATILE Integer &var, Integer delta);
+  INLINE static Integer add(TVOLATILE Integer &var, Integer delta);
   INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   INLINE static Integer get(const TVOLATILE Integer &var);
   INLINE static Integer get(const TVOLATILE Integer &var);
 
 

+ 6 - 2
dtool/src/dtoolbase/atomicAdjustI386Impl.I

@@ -59,14 +59,18 @@ dec(TVOLATILE AtomicAdjustI386Impl::Integer &var) {
 
 
 /**
 /**
  * Atomically computes var += delta.  It is legal for delta to be negative.
  * Atomically computes var += delta.  It is legal for delta to be negative.
+ * Returns the result of the addition.
  */
  */
-INLINE void AtomicAdjustI386Impl::
+INLINE AtomicAdjustI386Impl::Integer AtomicAdjustI386Impl::
 add(TVOLATILE AtomicAdjustI386Impl::Integer &var, AtomicAdjustI386Impl::Integer delta) {
 add(TVOLATILE AtomicAdjustI386Impl::Integer &var, AtomicAdjustI386Impl::Integer delta) {
   assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0);
   assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0);
   Integer orig_value = var;
   Integer orig_value = var;
-  while (compare_and_exchange(var, orig_value, orig_value + delta) != orig_value) {
+  Integer new_value = orig_value + delta;
+  while (compare_and_exchange(var, orig_value, new_value) != orig_value) {
     orig_value = var;
     orig_value = var;
+    new_value = orig_value + delta;
   }
   }
+  return new_value;
 }
 }
 
 
 /**
 /**

+ 1 - 1
dtool/src/dtoolbase/atomicAdjustI386Impl.h

@@ -34,7 +34,7 @@ public:
 
 
   INLINE static void inc(TVOLATILE Integer &var);
   INLINE static void inc(TVOLATILE Integer &var);
   INLINE static bool dec(TVOLATILE Integer &var);
   INLINE static bool dec(TVOLATILE Integer &var);
-  INLINE static void add(TVOLATILE Integer &var, Integer delta);
+  INLINE static Integer add(TVOLATILE Integer &var, Integer delta);
   INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   INLINE static Integer get(const TVOLATILE Integer &var);
   INLINE static Integer get(const TVOLATILE Integer &var);
 
 

+ 5 - 2
dtool/src/dtoolbase/atomicAdjustPosixImpl.I

@@ -35,13 +35,16 @@ dec(TVOLATILE AtomicAdjustPosixImpl::Integer &var) {
 
 
 /**
 /**
  * Atomically computes var += delta.  It is legal for delta to be negative.
  * Atomically computes var += delta.  It is legal for delta to be negative.
+ * Returns the result of the addition.
  */
  */
-INLINE void AtomicAdjustPosixImpl::
+INLINE AtomicAdjustPosixImpl::Integer AtomicAdjustPosixImpl::
 add(TVOLATILE AtomicAdjustPosixImpl::Integer &var,
 add(TVOLATILE AtomicAdjustPosixImpl::Integer &var,
     AtomicAdjustPosixImpl::Integer delta) {
     AtomicAdjustPosixImpl::Integer delta) {
   pthread_mutex_lock(&_mutex);
   pthread_mutex_lock(&_mutex);
-  var += delta;
+  Integer new_value = var + delta;
+  var = new_value;
   pthread_mutex_unlock(&_mutex);
   pthread_mutex_unlock(&_mutex);
+  return new_value;
 }
 }
 
 
 /**
 /**

+ 1 - 1
dtool/src/dtoolbase/atomicAdjustPosixImpl.h

@@ -35,7 +35,7 @@ public:
 
 
   INLINE static void inc(TVOLATILE Integer &var);
   INLINE static void inc(TVOLATILE Integer &var);
   INLINE static bool dec(TVOLATILE Integer &var);
   INLINE static bool dec(TVOLATILE Integer &var);
-  INLINE static void add(TVOLATILE Integer &var, Integer delta);
+  INLINE static Integer add(TVOLATILE Integer &var, Integer delta);
   INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   INLINE static Integer get(const TVOLATILE Integer &var);
   INLINE static Integer get(const TVOLATILE Integer &var);
 
 

+ 8 - 4
dtool/src/dtoolbase/atomicAdjustWin32Impl.I

@@ -40,17 +40,21 @@ dec(TVOLATILE AtomicAdjustWin32Impl::Integer &var) {
 
 
 /**
 /**
  * Atomically computes var += delta.  It is legal for delta to be negative.
  * Atomically computes var += delta.  It is legal for delta to be negative.
+ * Returns the result of the addition.
  */
  */
-INLINE void AtomicAdjustWin32Impl::
+INLINE AtomicAdjustWin32Impl::Integer AtomicAdjustWin32Impl::
 add(TVOLATILE AtomicAdjustWin32Impl::Integer &var, AtomicAdjustWin32Impl::Integer delta) {
 add(TVOLATILE AtomicAdjustWin32Impl::Integer &var, AtomicAdjustWin32Impl::Integer delta) {
   assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0);
   assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0);
 #ifdef _WIN64
 #ifdef _WIN64
-  InterlockedAdd64(&var, delta);
+  return InterlockedAdd64(&var, delta);
 #else
 #else
-  AtomicAdjustWin32Impl::Integer orig_value = var;
-  while (compare_and_exchange(var, orig_value, orig_value + delta) != orig_value) {
+  Integer orig_value = var;
+  Integer new_value = orig_value + delta;
+  while (compare_and_exchange(var, orig_value, new_value) != orig_value) {
     orig_value = var;
     orig_value = var;
+    new_value = orig_value + delta;
   }
   }
+  return new_value;
 #endif  // _WIN64
 #endif  // _WIN64
 }
 }
 
 

+ 1 - 1
dtool/src/dtoolbase/atomicAdjustWin32Impl.h

@@ -44,7 +44,7 @@ public:
 
 
   ALWAYS_INLINE static void inc(TVOLATILE Integer &var);
   ALWAYS_INLINE static void inc(TVOLATILE Integer &var);
   ALWAYS_INLINE static bool dec(TVOLATILE Integer &var);
   ALWAYS_INLINE static bool dec(TVOLATILE Integer &var);
-  INLINE static void add(TVOLATILE Integer &var, Integer delta);
+  INLINE static Integer add(TVOLATILE Integer &var, Integer delta);
   ALWAYS_INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   ALWAYS_INLINE static Integer set(TVOLATILE Integer &var, Integer new_value);
   ALWAYS_INLINE static Integer get(const TVOLATILE Integer &var);
   ALWAYS_INLINE static Integer get(const TVOLATILE Integer &var);
 
 

+ 1 - 1
dtool/src/dtoolbase/checkPandaVersion.h.in

@@ -56,7 +56,7 @@ extern EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@;
 template<typename T>
 template<typename T>
 class CheckPandaVersion {
 class CheckPandaVersion {
 public:
 public:
-  int check() { return @PANDA_VERSION_SYMBOL@; }
+  int check_version() { return @PANDA_VERSION_SYMBOL@; }
 };
 };
 
 
 template class CheckPandaVersion<void>;
 template class CheckPandaVersion<void>;

+ 5 - 5
dtool/src/dtoolbase/deletedBufferChain.cxx

@@ -43,11 +43,11 @@ allocate(size_t size, TypeHandle type_handle) {
 
 
   ObjectNode *obj;
   ObjectNode *obj;
 
 
-  _lock.acquire();
+  _lock.lock();
   if (_deleted_chain != (ObjectNode *)NULL) {
   if (_deleted_chain != (ObjectNode *)NULL) {
     obj = _deleted_chain;
     obj = _deleted_chain;
     _deleted_chain = _deleted_chain->_next;
     _deleted_chain = _deleted_chain->_next;
-    _lock.release();
+    _lock.unlock();
 
 
 #ifdef USE_DELETEDCHAINFLAG
 #ifdef USE_DELETEDCHAINFLAG
     assert(obj->_flag == (AtomicAdjust::Integer)DCF_deleted);
     assert(obj->_flag == (AtomicAdjust::Integer)DCF_deleted);
@@ -64,7 +64,7 @@ allocate(size_t size, TypeHandle type_handle) {
 
 
     return ptr;
     return ptr;
   }
   }
-  _lock.release();
+  _lock.unlock();
 
 
   // If we get here, the deleted_chain is empty; we have to allocate a new
   // If we get here, the deleted_chain is empty; we have to allocate a new
   // object from the system pool.
   // object from the system pool.
@@ -126,12 +126,12 @@ deallocate(void *ptr, TypeHandle type_handle) {
   assert(orig_flag == (AtomicAdjust::Integer)DCF_alive);
   assert(orig_flag == (AtomicAdjust::Integer)DCF_alive);
 #endif  // USE_DELETEDCHAINFLAG
 #endif  // USE_DELETEDCHAINFLAG
 
 
-  _lock.acquire();
+  _lock.lock();
 
 
   obj->_next = _deleted_chain;
   obj->_next = _deleted_chain;
   _deleted_chain = obj;
   _deleted_chain = obj;
 
 
-  _lock.release();
+  _lock.unlock();
 
 
 #else  // USE_DELETED_CHAIN
 #else  // USE_DELETED_CHAIN
   PANDA_FREE_SINGLE(ptr);
   PANDA_FREE_SINGLE(ptr);

+ 22 - 126
dtool/src/dtoolbase/dtoolbase_cc.h

@@ -19,6 +19,13 @@
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 
 
+// By including checkPandaVersion.h, we guarantee that runtime attempts to
+// load any DLL will fail if they inadvertently link with the wrong version of
+// dtool, which, transitively, means all DLLs must be from the same
+// (ABI-compatible) version of Panda.
+
+#include "checkPandaVersion.h"
+
 #ifdef USE_TAU
 #ifdef USE_TAU
 // Tau provides this destructive version of stdbool.h that we must mask.
 // Tau provides this destructive version of stdbool.h that we must mask.
 #define __PDT_STDBOOL_H_
 #define __PDT_STDBOOL_H_
@@ -33,16 +40,7 @@ using namespace std;
 #define INLINE inline
 #define INLINE inline
 #define ALWAYS_INLINE inline
 #define ALWAYS_INLINE inline
 #define TYPENAME typename
 #define TYPENAME typename
-#define CONSTEXPR constexpr
-#define ALWAYS_INLINE_CONSTEXPR constexpr
-#define NOEXCEPT noexcept
-#define FINAL final
 #define MOVE(x) x
 #define MOVE(x) x
-#define DEFAULT_CTOR = default
-#define DEFAULT_DTOR = default
-#define DEFAULT_ASSIGN = default
-#define DELETED = delete
-#define DELETED_ASSIGN = delete
 
 
 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
 #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
 
 
@@ -81,15 +79,9 @@ typedef int ios_seekdir;
 #include <string>
 #include <string>
 #include <utility>
 #include <utility>
 
 
-#ifdef HAVE_NAMESPACE
 using namespace std;
 using namespace std;
-#endif
 
 
-#ifdef HAVE_TYPENAME
 #define TYPENAME typename
 #define TYPENAME typename
-#else
-#define TYPENAME
-#endif
 
 
 #ifndef HAVE_WCHAR_T
 #ifndef HAVE_WCHAR_T
 // Some C++ libraries (os x 3.1) don't define this.
 // Some C++ libraries (os x 3.1) don't define this.
@@ -124,18 +116,20 @@ typedef ios::seekdir ios_seekdir;
 #if defined(__GLIBCXX__) && __GLIBCXX__ <= 20070719
 #if defined(__GLIBCXX__) && __GLIBCXX__ <= 20070719
 #include <tr1/tuple>
 #include <tr1/tuple>
 
 
-using std::tr1::tuple;
-using std::tr1::tie;
+namespace std {
+  using std::tr1::tuple;
+  using std::tr1::tie;
 
 
-typedef decltype(nullptr) nullptr_t;
+  typedef decltype(nullptr) nullptr_t;
 
 
-template<class T> struct remove_reference      {typedef T type;};
-template<class T> struct remove_reference<T&>  {typedef T type;};
-template<class T> struct remove_reference<T&& >{typedef T type;};
+  template<class T> struct remove_reference      {typedef T type;};
+  template<class T> struct remove_reference<T&>  {typedef T type;};
+  template<class T> struct remove_reference<T&& >{typedef T type;};
 
 
-template<class T> typename remove_reference<T>::type &&move(T &&t) {
-  return static_cast<typename remove_reference<T>::type&&>(t);
-}
+  template<class T> typename remove_reference<T>::type &&move(T &&t) {
+    return static_cast<typename remove_reference<T>::type&&>(t);
+  }
+};
 #endif
 #endif
 
 
 #ifdef _MSC_VER
 #ifdef _MSC_VER
@@ -156,110 +150,12 @@ template<class T> typename remove_reference<T>::type &&move(T &&t) {
 #endif
 #endif
 
 
 // Determine the availability of C++11 features.
 // Determine the availability of C++11 features.
-#if defined(__has_extension) // Clang magic.
-#  if __has_extension(cxx_constexpr)
-#    if !defined(__apple_build_version__) || __apple_build_version__ >= 5000000
-#      define CONSTEXPR constexpr
-#    endif
-#  endif
-#  if __has_extension(cxx_noexcept)
-#    define NOEXCEPT noexcept
-#  endif
-#  if __has_extension(cxx_rvalue_references) && (__cplusplus >= 201103L)
-#    define USE_MOVE_SEMANTICS
-#    define MOVE(x) move(x)
-#  endif
-#  if __has_extension(cxx_override_control) && (__cplusplus >= 201103L)
-#    define FINAL final
-#  endif
-#  if __has_extension(cxx_defaulted_functions)
-#     define DEFAULT_CTOR = default
-#     define DEFAULT_DTOR = default
-#     define DEFAULT_ASSIGN = default
-#  endif
-#  if __has_extension(cxx_deleted_functions)
-#     define DELETED = delete
-#  endif
-#elif defined(__GNUC__) // GCC
-
-// Starting at GCC 4.4
-#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-#  define DEFAULT_CTOR = default
-#  define DEFAULT_DTOR = default
-#  define DEFAULT_ASSIGN = default
-#  define DELETED = delete
-#  endif
-
-// Starting at GCC 4.6
-#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
-#    define CONSTEXPR constexpr
-#    define NOEXCEPT noexcept
-#    define USE_MOVE_SEMANTICS
-#    define MOVE(x) move(x)
-#  endif
-
-// Starting at GCC 4.7
-#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
-#    define FINAL final
-#  endif
-
-// GCC defines several macros which we can query.  List of all supported
-// builtin macros: https://gcc.gnu.org/projects/cxx-status.html
-#  if !defined(CONSTEXPR) && __cpp_constexpr >= 200704
-#    define CONSTEXPR constexpr
-#  endif
-
-#elif defined(_MSC_VER) && _MSC_VER >= 1900 // Visual Studio 2015
-#  define CONSTEXPR constexpr
-#  define NOEXCEPT noexcept
-#  define USE_MOVE_SEMANTICS
-#  define FINAL final
-#  define MOVE(x) move(x)
-#elif defined(_MSC_VER) && _MSC_VER >= 1600 // Visual Studio 2010
-#  define NOEXCEPT throw()
-#  define USE_MOVE_SEMANTICS
-#  define FINAL sealed
-#  define MOVE(x) move(x)
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER >= 1800 // Visual Studio 2013
-#  define DEFAULT_CTOR = default
-#  define DEFAULT_DTOR = default
-#  define DEFAULT_ASSIGN = default
-#  define DELETED = delete
+#if defined(_MSC_VER) && _MSC_VER < 1900 // Visual Studio 2015
+#error Microsoft Visual C++ 2015 or later is required to compile Panda3D.
 #endif
 #endif
 
 
-// Fallbacks if features are not supported
-#ifndef CONSTEXPR
-#  define CONSTEXPR INLINE
-#  define ALWAYS_INLINE_CONSTEXPR ALWAYS_INLINE
-#else
-#  define ALWAYS_INLINE_CONSTEXPR ALWAYS_INLINE CONSTEXPR
-#endif
-#ifndef NOEXCEPT
-#  define NOEXCEPT
-#endif
-#ifndef MOVE
-#  define MOVE(x) x
-#endif
-#ifndef FINAL
-#  define FINAL
-#endif
-#ifndef DEFAULT_CTOR
-#  define DEFAULT_CTOR {}
-#endif
-#ifndef DEFAULT_DTOR
-#  define DEFAULT_DTOR {}
-#endif
-#ifndef DEFAULT_ASSIGN
-#  define DEFAULT_ASSIGN {return *this;}
-#endif
-#ifndef DELETED
-#  define DELETED {assert(false);}
-#  define DELETED_ASSIGN {assert(false);return *this;}
-#else
-#  define DELETED_ASSIGN DELETED
-#endif
+// This is just to support code generated with older versions of interrogate.
+#define MOVE(x) (std::move(x))
 
 
 
 
 #ifndef LINK_ALL_STATIC
 #ifndef LINK_ALL_STATIC

+ 0 - 2
dtool/src/dtoolbase/fakestringstream.h

@@ -18,9 +18,7 @@
 #include <string.h>
 #include <string.h>
 #include <string>
 #include <string>
 
 
-#ifdef HAVE_NAMESPACE
 using namespace std;
 using namespace std;
-#endif
 
 
 class fake_istream_buffer {
 class fake_istream_buffer {
 public:
 public:

+ 0 - 9
dtool/src/dtoolbase/memoryHook.I

@@ -34,15 +34,6 @@ dec_heap(size_t size) {
 #endif  // DO_MEMORY_USAGE
 #endif  // DO_MEMORY_USAGE
 }
 }
 
 
-/**
- * Returns the global memory alignment.  This is the number of bytes at which
- * each allocated memory pointer will be aligned.
- */
-CONSTEXPR size_t MemoryHook::
-get_memory_alignment() {
-  return MEMORY_HOOK_ALIGNMENT;
-}
-
 /**
 /**
  * Returns the operating system page size.  This is the minimum granularity
  * Returns the operating system page size.  This is the minimum granularity
  * required for calls to mmap_alloc().  Also see round_up_to_page_size().
  * required for calls to mmap_alloc().  Also see round_up_to_page_size().

+ 22 - 22
dtool/src/dtoolbase/memoryHook.cxx

@@ -223,9 +223,9 @@ MemoryHook(const MemoryHook &copy) :
   _total_mmap_size(copy._total_mmap_size),
   _total_mmap_size(copy._total_mmap_size),
   _max_heap_size(copy._max_heap_size) {
   _max_heap_size(copy._max_heap_size) {
 
 
-  copy._lock.acquire();
+  copy._lock.lock();
   _deleted_chains = copy._deleted_chains;
   _deleted_chains = copy._deleted_chains;
-  copy._lock.release();
+  copy._lock.unlock();
 }
 }
 
 
 /**
 /**
@@ -249,9 +249,9 @@ heap_alloc_single(size_t size) {
   size_t inflated_size = inflate_size(size);
   size_t inflated_size = inflate_size(size);
 
 
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-  _lock.acquire();
+  _lock.lock();
   void *alloc = call_malloc(inflated_size);
   void *alloc = call_malloc(inflated_size);
-  _lock.release();
+  _lock.unlock();
 #else
 #else
   void *alloc = call_malloc(inflated_size);
   void *alloc = call_malloc(inflated_size);
 #endif
 #endif
@@ -259,9 +259,9 @@ heap_alloc_single(size_t size) {
   while (alloc == (void *)NULL) {
   while (alloc == (void *)NULL) {
     alloc_fail(inflated_size);
     alloc_fail(inflated_size);
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-    _lock.acquire();
+    _lock.lock();
     alloc = call_malloc(inflated_size);
     alloc = call_malloc(inflated_size);
-    _lock.release();
+    _lock.unlock();
 #else
 #else
     alloc = call_malloc(inflated_size);
     alloc = call_malloc(inflated_size);
 #endif
 #endif
@@ -305,9 +305,9 @@ heap_free_single(void *ptr) {
 #endif  // DO_MEMORY_USAGE
 #endif  // DO_MEMORY_USAGE
 
 
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-  _lock.acquire();
+  _lock.lock();
   call_free(alloc);
   call_free(alloc);
-  _lock.release();
+  _lock.unlock();
 #else
 #else
   call_free(alloc);
   call_free(alloc);
 #endif
 #endif
@@ -326,9 +326,9 @@ heap_alloc_array(size_t size) {
   size_t inflated_size = inflate_size(size);
   size_t inflated_size = inflate_size(size);
 
 
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-  _lock.acquire();
+  _lock.lock();
   void *alloc = call_malloc(inflated_size);
   void *alloc = call_malloc(inflated_size);
-  _lock.release();
+  _lock.unlock();
 #else
 #else
   void *alloc = call_malloc(inflated_size);
   void *alloc = call_malloc(inflated_size);
 #endif
 #endif
@@ -336,9 +336,9 @@ heap_alloc_array(size_t size) {
   while (alloc == (void *)NULL) {
   while (alloc == (void *)NULL) {
     alloc_fail(inflated_size);
     alloc_fail(inflated_size);
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-    _lock.acquire();
+    _lock.lock();
     alloc = call_malloc(inflated_size);
     alloc = call_malloc(inflated_size);
-    _lock.release();
+    _lock.unlock();
 #else
 #else
     alloc = call_malloc(inflated_size);
     alloc = call_malloc(inflated_size);
 #endif
 #endif
@@ -380,9 +380,9 @@ heap_realloc_array(void *ptr, size_t size) {
 
 
   void *alloc1 = alloc;
   void *alloc1 = alloc;
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-  _lock.acquire();
+  _lock.lock();
   alloc1 = call_realloc(alloc1, inflated_size);
   alloc1 = call_realloc(alloc1, inflated_size);
-  _lock.release();
+  _lock.unlock();
 #else
 #else
   alloc1 = call_realloc(alloc1, inflated_size);
   alloc1 = call_realloc(alloc1, inflated_size);
 #endif
 #endif
@@ -394,9 +394,9 @@ heap_realloc_array(void *ptr, size_t size) {
     alloc1 = alloc;
     alloc1 = alloc;
 
 
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-    _lock.acquire();
+    _lock.lock();
     alloc1 = call_realloc(alloc1, inflated_size);
     alloc1 = call_realloc(alloc1, inflated_size);
-    _lock.release();
+    _lock.unlock();
 #else
 #else
     alloc1 = call_realloc(alloc1, inflated_size);
     alloc1 = call_realloc(alloc1, inflated_size);
 #endif
 #endif
@@ -453,9 +453,9 @@ heap_free_array(void *ptr) {
 #endif  // DO_MEMORY_USAGE
 #endif  // DO_MEMORY_USAGE
 
 
 #ifdef MEMORY_HOOK_MALLOC_LOCK
 #ifdef MEMORY_HOOK_MALLOC_LOCK
-  _lock.acquire();
+  _lock.lock();
   call_free(alloc);
   call_free(alloc);
-  _lock.release();
+  _lock.unlock();
 #else
 #else
   call_free(alloc);
   call_free(alloc);
 #endif
 #endif
@@ -478,11 +478,11 @@ heap_trim(size_t pad) {
   // Since malloc_trim() isn't standard C, we can't be sure it exists on a
   // Since malloc_trim() isn't standard C, we can't be sure it exists on a
   // given platform.  But if we're using dlmalloc, we know we have
   // given platform.  But if we're using dlmalloc, we know we have
   // dlmalloc_trim.
   // dlmalloc_trim.
-  _lock.acquire();
+  _lock.lock();
   if (dlmalloc_trim(pad)) {
   if (dlmalloc_trim(pad)) {
     trimmed = true;
     trimmed = true;
   }
   }
-  _lock.release();
+  _lock.unlock();
 #endif
 #endif
 
 
 #ifdef WIN32
 #ifdef WIN32
@@ -596,7 +596,7 @@ DeletedBufferChain *MemoryHook::
 get_deleted_chain(size_t buffer_size) {
 get_deleted_chain(size_t buffer_size) {
   DeletedBufferChain *chain;
   DeletedBufferChain *chain;
 
 
-  _lock.acquire();
+  _lock.lock();
   DeletedChains::iterator dci = _deleted_chains.find(buffer_size);
   DeletedChains::iterator dci = _deleted_chains.find(buffer_size);
   if (dci != _deleted_chains.end()) {
   if (dci != _deleted_chains.end()) {
     chain = (*dci).second;
     chain = (*dci).second;
@@ -606,7 +606,7 @@ get_deleted_chain(size_t buffer_size) {
     _deleted_chains.insert(DeletedChains::value_type(buffer_size, chain));
     _deleted_chains.insert(DeletedChains::value_type(buffer_size, chain));
   }
   }
 
 
-  _lock.release();
+  _lock.unlock();
   return chain;
   return chain;
 }
 }
 
 

+ 3 - 1
dtool/src/dtoolbase/memoryHook.h

@@ -52,7 +52,9 @@ public:
 
 
   bool heap_trim(size_t pad);
   bool heap_trim(size_t pad);
 
 
-  CONSTEXPR static size_t get_memory_alignment();
+  constexpr static size_t get_memory_alignment() {
+    return MEMORY_HOOK_ALIGNMENT;
+  }
 
 
   virtual void *mmap_alloc(size_t size, bool allow_exec);
   virtual void *mmap_alloc(size_t size, bool allow_exec);
   virtual void mmap_free(void *ptr, size_t size);
   virtual void mmap_free(void *ptr, size_t size);

+ 3 - 3
dtool/src/dtoolbase/mutexDummyImpl.I

@@ -15,14 +15,14 @@
  *
  *
  */
  */
 ALWAYS_INLINE void MutexDummyImpl::
 ALWAYS_INLINE void MutexDummyImpl::
-acquire() {
+lock() {
 }
 }
 
 
 /**
 /**
  *
  *
  */
  */
 ALWAYS_INLINE bool MutexDummyImpl::
 ALWAYS_INLINE bool MutexDummyImpl::
-try_acquire() {
+try_lock() {
   return true;
   return true;
 }
 }
 
 
@@ -30,5 +30,5 @@ try_acquire() {
  *
  *
  */
  */
 ALWAYS_INLINE void MutexDummyImpl::
 ALWAYS_INLINE void MutexDummyImpl::
-release() {
+unlock() {
 }
 }

+ 6 - 7
dtool/src/dtoolbase/mutexDummyImpl.h

@@ -23,16 +23,15 @@
  */
  */
 class EXPCL_DTOOL_DTOOLBASE MutexDummyImpl {
 class EXPCL_DTOOL_DTOOLBASE MutexDummyImpl {
 public:
 public:
-  CONSTEXPR MutexDummyImpl() DEFAULT_CTOR;
+  constexpr MutexDummyImpl() = default;
+  MutexDummyImpl(const MutexDummyImpl &copy) = delete;
 
 
-private:
-  MutexDummyImpl(const MutexDummyImpl &copy) DELETED;
-  MutexDummyImpl &operator = (const MutexDummyImpl &copy) DELETED_ASSIGN;
+  MutexDummyImpl &operator = (const MutexDummyImpl &copy) = delete;
 
 
 public:
 public:
-  ALWAYS_INLINE void acquire();
-  ALWAYS_INLINE bool try_acquire();
-  ALWAYS_INLINE void release();
+  ALWAYS_INLINE void lock();
+  ALWAYS_INLINE bool try_lock();
+  ALWAYS_INLINE void unlock();
 };
 };
 
 
 #include "mutexDummyImpl.I"
 #include "mutexDummyImpl.I"

+ 16 - 32
dtool/src/dtoolbase/mutexPosixImpl.I

@@ -14,8 +14,8 @@
 /**
 /**
  *
  *
  */
  */
-CONSTEXPR MutexPosixImpl::
-MutexPosixImpl() NOEXCEPT : _lock(PTHREAD_MUTEX_INITIALIZER) {
+constexpr MutexPosixImpl::
+MutexPosixImpl() noexcept : _lock(PTHREAD_MUTEX_INITIALIZER) {
 }
 }
 
 
 /**
 /**
@@ -32,8 +32,8 @@ INLINE MutexPosixImpl::
  *
  *
  */
  */
 INLINE void MutexPosixImpl::
 INLINE void MutexPosixImpl::
-acquire() {
-  TAU_PROFILE("void MutexPosixImpl::acquire", " ", TAU_USER);
+lock() {
+  TAU_PROFILE("void MutexPosixImpl::lock", " ", TAU_USER);
   int result = pthread_mutex_lock(&_lock);
   int result = pthread_mutex_lock(&_lock);
   assert(result == 0);
   assert(result == 0);
 }
 }
@@ -42,8 +42,8 @@ acquire() {
  *
  *
  */
  */
 INLINE bool MutexPosixImpl::
 INLINE bool MutexPosixImpl::
-try_acquire() {
-  TAU_PROFILE("bool MutexPosixImpl::try_acquire", " ", TAU_USER);
+try_lock() {
+  TAU_PROFILE("bool MutexPosixImpl::try_lock", " ", TAU_USER);
   int result = pthread_mutex_trylock(&_lock);
   int result = pthread_mutex_trylock(&_lock);
   assert(result == 0 || result == EBUSY);
   assert(result == 0 || result == EBUSY);
   return (result == 0);
   return (result == 0);
@@ -53,26 +53,18 @@ try_acquire() {
  *
  *
  */
  */
 INLINE void MutexPosixImpl::
 INLINE void MutexPosixImpl::
-release() {
-  TAU_PROFILE("void MutexPosixImpl::release", " ", TAU_USER);
+unlock() {
+  TAU_PROFILE("void MutexPosixImpl::unlock", " ", TAU_USER);
   int result = pthread_mutex_unlock(&_lock);
   int result = pthread_mutex_unlock(&_lock);
   assert(result == 0);
   assert(result == 0);
 }
 }
 
 
-/**
- * Returns the underlying Posix lock handle.
- */
-INLINE pthread_mutex_t *MutexPosixImpl::
-get_posix_lock() {
-  return &_lock;
-}
-
 /**
 /**
  *
  *
  */
  */
 #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-CONSTEXPR ReMutexPosixImpl::
-ReMutexPosixImpl() NOEXCEPT : _lock(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) {
+constexpr ReMutexPosixImpl::
+ReMutexPosixImpl() noexcept : _lock(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) {
 }
 }
 #else
 #else
 INLINE ReMutexPosixImpl::
 INLINE ReMutexPosixImpl::
@@ -101,8 +93,8 @@ INLINE ReMutexPosixImpl::
  *
  *
  */
  */
 INLINE void ReMutexPosixImpl::
 INLINE void ReMutexPosixImpl::
-acquire() {
-  TAU_PROFILE("void ReMutexPosixImpl::acquire", " ", TAU_USER);
+lock() {
+  TAU_PROFILE("void ReMutexPosixImpl::lock", " ", TAU_USER);
   int result = pthread_mutex_lock(&_lock);
   int result = pthread_mutex_lock(&_lock);
   assert(result == 0);
   assert(result == 0);
 }
 }
@@ -111,8 +103,8 @@ acquire() {
  *
  *
  */
  */
 INLINE bool ReMutexPosixImpl::
 INLINE bool ReMutexPosixImpl::
-try_acquire() {
-  TAU_PROFILE("bool ReMutexPosixImpl::try_acquire", " ", TAU_USER);
+try_lock() {
+  TAU_PROFILE("bool ReMutexPosixImpl::try_lock", " ", TAU_USER);
   int result = pthread_mutex_trylock(&_lock);
   int result = pthread_mutex_trylock(&_lock);
   assert(result == 0 || result == EBUSY);
   assert(result == 0 || result == EBUSY);
   return (result == 0);
   return (result == 0);
@@ -122,16 +114,8 @@ try_acquire() {
  *
  *
  */
  */
 INLINE void ReMutexPosixImpl::
 INLINE void ReMutexPosixImpl::
-release() {
-  TAU_PROFILE("void ReMutexPosixImpl::release", " ", TAU_USER);
+unlock() {
+  TAU_PROFILE("void ReMutexPosixImpl::unlock", " ", TAU_USER);
   int result = pthread_mutex_unlock(&_lock);
   int result = pthread_mutex_unlock(&_lock);
   assert(result == 0);
   assert(result == 0);
 }
 }
-
-/**
- * Returns the underlying Posix lock handle.
- */
-INLINE pthread_mutex_t *ReMutexPosixImpl::
-get_posix_lock() {
-  return &_lock;
-}

+ 12 - 18
dtool/src/dtoolbase/mutexPosixImpl.h

@@ -28,19 +28,16 @@
  */
  */
 class EXPCL_DTOOL_DTOOLBASE MutexPosixImpl {
 class EXPCL_DTOOL_DTOOLBASE MutexPosixImpl {
 public:
 public:
-  CONSTEXPR MutexPosixImpl() NOEXCEPT;
+  constexpr MutexPosixImpl() noexcept;
+  MutexPosixImpl(const MutexPosixImpl &copy) = delete;
   INLINE ~MutexPosixImpl();
   INLINE ~MutexPosixImpl();
 
 
-private:
-  MutexPosixImpl(const MutexPosixImpl &copy) DELETED;
-  MutexPosixImpl &operator = (const MutexPosixImpl &copy) DELETED_ASSIGN;
+  MutexPosixImpl &operator = (const MutexPosixImpl &copy) = delete;
 
 
 public:
 public:
-  INLINE void acquire();
-  INLINE bool try_acquire();
-  INLINE void release();
-
-  INLINE pthread_mutex_t *get_posix_lock();
+  INLINE void lock();
+  INLINE bool try_lock();
+  INLINE void unlock();
 
 
 private:
 private:
   pthread_mutex_t _lock;
   pthread_mutex_t _lock;
@@ -53,22 +50,19 @@ private:
 class EXPCL_DTOOL_DTOOLBASE ReMutexPosixImpl {
 class EXPCL_DTOOL_DTOOLBASE ReMutexPosixImpl {
 public:
 public:
 #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-  CONSTEXPR ReMutexPosixImpl() NOEXCEPT;
+  constexpr ReMutexPosixImpl() noexcept;
 #else
 #else
   INLINE ReMutexPosixImpl();
   INLINE ReMutexPosixImpl();
 #endif
 #endif
+  ReMutexPosixImpl(const ReMutexPosixImpl &copy) = delete;
   INLINE ~ReMutexPosixImpl();
   INLINE ~ReMutexPosixImpl();
 
 
-private:
-  ReMutexPosixImpl(const ReMutexPosixImpl &copy) DELETED;
-  ReMutexPosixImpl &operator = (const ReMutexPosixImpl &copy) DELETED;
+  ReMutexPosixImpl &operator = (const ReMutexPosixImpl &copy) = delete;
 
 
 public:
 public:
-  INLINE void acquire();
-  INLINE bool try_acquire();
-  INLINE void release();
-
-  INLINE pthread_mutex_t *get_posix_lock();
+  INLINE void lock();
+  INLINE bool try_lock();
+  INLINE void unlock();
 
 
 private:
 private:
   pthread_mutex_t _lock;
   pthread_mutex_t _lock;

+ 5 - 5
dtool/src/dtoolbase/mutexSpinlockImpl.I

@@ -14,7 +14,7 @@
 /**
 /**
  *
  *
  */
  */
-CONSTEXPR MutexSpinlockImpl::
+constexpr MutexSpinlockImpl::
 MutexSpinlockImpl() : _lock(0) {
 MutexSpinlockImpl() : _lock(0) {
 }
 }
 
 
@@ -22,8 +22,8 @@ MutexSpinlockImpl() : _lock(0) {
  *
  *
  */
  */
 INLINE void MutexSpinlockImpl::
 INLINE void MutexSpinlockImpl::
-acquire() {
-  if (!try_acquire()) {
+lock() {
+  if (!try_lock()) {
     do_lock();
     do_lock();
   }
   }
 }
 }
@@ -32,7 +32,7 @@ acquire() {
  *
  *
  */
  */
 INLINE bool MutexSpinlockImpl::
 INLINE bool MutexSpinlockImpl::
-try_acquire() {
+try_lock() {
   return (AtomicAdjust::compare_and_exchange(_lock, 0, 1) == 0);
   return (AtomicAdjust::compare_and_exchange(_lock, 0, 1) == 0);
 }
 }
 
 
@@ -40,6 +40,6 @@ try_acquire() {
  *
  *
  */
  */
 INLINE void MutexSpinlockImpl::
 INLINE void MutexSpinlockImpl::
-release() {
+unlock() {
   AtomicAdjust::set(_lock, 0);
   AtomicAdjust::set(_lock, 0);
 }
 }

+ 6 - 7
dtool/src/dtoolbase/mutexSpinlockImpl.h

@@ -29,16 +29,15 @@
  */
  */
 class EXPCL_DTOOL_DTOOLBASE MutexSpinlockImpl {
 class EXPCL_DTOOL_DTOOLBASE MutexSpinlockImpl {
 public:
 public:
-  CONSTEXPR MutexSpinlockImpl();
+  constexpr MutexSpinlockImpl();
+  MutexSpinlockImpl(const MutexSpinlockImpl &copy) = delete;
 
 
-private:
-  MutexSpinlockImpl(const MutexSpinlockImpl &copy) DELETED;
-  MutexSpinlockImpl &operator = (const MutexSpinlockImpl &copy) DELETED_ASSIGN;
+  MutexSpinlockImpl &operator = (const MutexSpinlockImpl &copy) = delete;
 
 
 public:
 public:
-  INLINE void acquire();
-  INLINE bool try_acquire();
-  INLINE void release();
+  INLINE void lock();
+  INLINE bool try_lock();
+  INLINE void unlock();
 
 
 private:
 private:
   void do_lock();
   void do_lock();

+ 3 - 3
dtool/src/dtoolbase/mutexWin32Impl.I

@@ -23,7 +23,7 @@ INLINE MutexWin32Impl::
  *
  *
  */
  */
 INLINE void MutexWin32Impl::
 INLINE void MutexWin32Impl::
-acquire() {
+lock() {
   EnterCriticalSection(&_lock);
   EnterCriticalSection(&_lock);
 }
 }
 
 
@@ -31,7 +31,7 @@ acquire() {
  *
  *
  */
  */
 INLINE bool MutexWin32Impl::
 INLINE bool MutexWin32Impl::
-try_acquire() {
+try_lock() {
   return (TryEnterCriticalSection(&_lock) != 0);
   return (TryEnterCriticalSection(&_lock) != 0);
 }
 }
 
 
@@ -39,6 +39,6 @@ try_acquire() {
  *
  *
  */
  */
 INLINE void MutexWin32Impl::
 INLINE void MutexWin32Impl::
-release() {
+unlock() {
   LeaveCriticalSection(&_lock);
   LeaveCriticalSection(&_lock);
 }
 }

+ 5 - 6
dtool/src/dtoolbase/mutexWin32Impl.h

@@ -29,16 +29,15 @@
 class EXPCL_DTOOL_DTOOLBASE MutexWin32Impl {
 class EXPCL_DTOOL_DTOOLBASE MutexWin32Impl {
 public:
 public:
   MutexWin32Impl();
   MutexWin32Impl();
+  MutexWin32Impl(const MutexWin32Impl &copy) = delete;
   INLINE ~MutexWin32Impl();
   INLINE ~MutexWin32Impl();
 
 
-private:
-  MutexWin32Impl(const MutexWin32Impl &copy) DELETED;
-  MutexWin32Impl &operator = (const MutexWin32Impl &copy) DELETED_ASSIGN;
+  MutexWin32Impl &operator = (const MutexWin32Impl &copy) = delete;
 
 
 public:
 public:
-  INLINE void acquire();
-  INLINE bool try_acquire();
-  INLINE void release();
+  INLINE void lock();
+  INLINE bool try_lock();
+  INLINE void unlock();
 
 
 private:
 private:
   CRITICAL_SECTION _lock;
   CRITICAL_SECTION _lock;

+ 3 - 3
dtool/src/dtoolbase/nearly_zero.h

@@ -24,17 +24,17 @@
 // identifier, and then returning the value of that identifier, seems to lead
 // identifier, and then returning the value of that identifier, seems to lead
 // to compilation errors (at least in VC7) in which sometimes
 // to compilation errors (at least in VC7) in which sometimes
 // IS_THRESHOLD_COMPEQ(a, a, get_nearly_zero_value(a)) != 0.
 // IS_THRESHOLD_COMPEQ(a, a, get_nearly_zero_value(a)) != 0.
-CONSTEXPR double
+constexpr double
 get_nearly_zero_value(double) {
 get_nearly_zero_value(double) {
   return 1.0e-12;
   return 1.0e-12;
 }
 }
 
 
-CONSTEXPR float
+constexpr float
 get_nearly_zero_value(float) {
 get_nearly_zero_value(float) {
   return 1.0e-6f;
   return 1.0e-6f;
 }
 }
 
 
-CONSTEXPR int
+constexpr int
 get_nearly_zero_value(int) {
 get_nearly_zero_value(int) {
   // This is a bit silly, but we should nevertheless define it in case it is
   // This is a bit silly, but we should nevertheless define it in case it is
   // called for an integer type.
   // called for an integer type.

+ 2 - 2
dtool/src/dtoolbase/neverFreeMemory.I

@@ -48,9 +48,9 @@ get_total_used() {
 INLINE size_t NeverFreeMemory::
 INLINE size_t NeverFreeMemory::
 get_total_unused() {
 get_total_unused() {
   NeverFreeMemory *global_ptr = get_global_ptr();
   NeverFreeMemory *global_ptr = get_global_ptr();
-  global_ptr->_lock.acquire();
+  global_ptr->_lock.lock();
   size_t total_unused = global_ptr->_total_alloc - global_ptr->_total_used;
   size_t total_unused = global_ptr->_total_alloc - global_ptr->_total_used;
-  global_ptr->_lock.release();
+  global_ptr->_lock.unlock();
   return total_unused;
   return total_unused;
 }
 }
 
 

+ 3 - 3
dtool/src/dtoolbase/neverFreeMemory.cxx

@@ -37,7 +37,7 @@ NeverFreeMemory() {
  */
  */
 void *NeverFreeMemory::
 void *NeverFreeMemory::
 ns_alloc(size_t size) {
 ns_alloc(size_t size) {
-  _lock.acquire();
+  _lock.lock();
 
 
   //NB: we no longer do alignment here.  The only class that uses this is
   //NB: we no longer do alignment here.  The only class that uses this is
   // DeletedBufferChain, and we can do the alignment potentially more
   // DeletedBufferChain, and we can do the alignment potentially more
@@ -55,7 +55,7 @@ ns_alloc(size_t size) {
     if (page._remaining >= min_page_remaining_size) {
     if (page._remaining >= min_page_remaining_size) {
       _pages.insert(page);
       _pages.insert(page);
     }
     }
-    _lock.release();
+    _lock.unlock();
     return result;
     return result;
   }
   }
 
 
@@ -71,7 +71,7 @@ ns_alloc(size_t size) {
   if (page._remaining >= min_page_remaining_size) {
   if (page._remaining >= min_page_remaining_size) {
     _pages.insert(page);
     _pages.insert(page);
   }
   }
-  _lock.release();
+  _lock.unlock();
   return result;
   return result;
 }
 }
 
 

+ 2 - 2
dtool/src/dtoolbase/pallocator.T

@@ -13,7 +13,7 @@
 
 
 template<class Type>
 template<class Type>
 INLINE pallocator_single<Type>::
 INLINE pallocator_single<Type>::
-pallocator_single(TypeHandle type_handle) NOEXCEPT :
+pallocator_single(TypeHandle type_handle) noexcept :
   _type_handle(type_handle)
   _type_handle(type_handle)
 {
 {
 }
 }
@@ -37,7 +37,7 @@ deallocate(TYPENAME pallocator_single<Type>::pointer p, TYPENAME pallocator_sing
 
 
 template<class Type>
 template<class Type>
 INLINE pallocator_array<Type>::
 INLINE pallocator_array<Type>::
-pallocator_array(TypeHandle type_handle) NOEXCEPT :
+pallocator_array(TypeHandle type_handle) noexcept :
   _type_handle(type_handle)
   _type_handle(type_handle)
 {
 {
 }
 }

+ 4 - 4
dtool/src/dtoolbase/pallocator.h

@@ -52,11 +52,11 @@ public:
   typedef TYPENAME allocator<Type>::const_reference const_reference;
   typedef TYPENAME allocator<Type>::const_reference const_reference;
   typedef TYPENAME allocator<Type>::size_type size_type;
   typedef TYPENAME allocator<Type>::size_type size_type;
 
 
-  INLINE pallocator_single(TypeHandle type_handle) NOEXCEPT;
+  INLINE pallocator_single(TypeHandle type_handle) noexcept;
 
 
   // template member functions in VC++ can only be defined in-class.
   // template member functions in VC++ can only be defined in-class.
   template<class U>
   template<class U>
-  INLINE pallocator_single(const pallocator_single<U> &copy) NOEXCEPT :
+  INLINE pallocator_single(const pallocator_single<U> &copy) noexcept :
     _type_handle(copy._type_handle) { }
     _type_handle(copy._type_handle) { }
 
 
   INLINE Type *allocate(size_type n, allocator<void>::const_pointer hint = 0)
   INLINE Type *allocate(size_type n, allocator<void>::const_pointer hint = 0)
@@ -81,11 +81,11 @@ public:
   typedef TYPENAME allocator<Type>::const_reference const_reference;
   typedef TYPENAME allocator<Type>::const_reference const_reference;
   typedef TYPENAME allocator<Type>::size_type size_type;
   typedef TYPENAME allocator<Type>::size_type size_type;
 
 
-  INLINE pallocator_array(TypeHandle type_handle = TypeHandle::none()) NOEXCEPT;
+  INLINE pallocator_array(TypeHandle type_handle = TypeHandle::none()) noexcept;
 
 
   // template member functions in VC++ can only be defined in-class.
   // template member functions in VC++ can only be defined in-class.
   template<class U>
   template<class U>
-  INLINE pallocator_array(const pallocator_array<U> &copy) NOEXCEPT :
+  INLINE pallocator_array(const pallocator_array<U> &copy) noexcept :
     _type_handle(copy._type_handle) { }
     _type_handle(copy._type_handle) { }
 
 
   INLINE Type *allocate(size_type n, allocator<void>::const_pointer hint = 0)
   INLINE Type *allocate(size_type n, allocator<void>::const_pointer hint = 0)

+ 4 - 0
dtool/src/dtoolbase/pandaVersion.h.in

@@ -49,6 +49,10 @@
    out from CVS by the builder). */
    out from CVS by the builder). */
 #define PANDA_VERSION_STR "@PANDA_VERSION_STR@"
 #define PANDA_VERSION_STR "@PANDA_VERSION_STR@"
 
 
+/* This is the Git commit we built Panda from, or an empty string if this isn't
+   known. */
+#define PANDA_GIT_COMMIT_STR "@PANDA_GIT_COMMIT_STR@"
+
 /* This is the version of the Panda3D ABI expressed as a string.
 /* This is the version of the Panda3D ABI expressed as a string.
    This usually means the major and minor version. It should be the
    This usually means the major and minor version. It should be the
    same for Panda3D versions that are supposed to be backward
    same for Panda3D versions that are supposed to be backward

+ 6 - 9
dtool/src/dtoolbase/pvector.h

@@ -43,25 +43,22 @@ class pvector : public vector<Type, pallocator_array<Type> > {
 public:
 public:
   typedef pallocator_array<Type> allocator;
   typedef pallocator_array<Type> allocator;
   typedef vector<Type, allocator> base_class;
   typedef vector<Type, allocator> base_class;
-  typedef TYPENAME base_class::size_type size_type;
+  typedef typename base_class::size_type size_type;
 
 
   explicit pvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator(type_handle)) { }
   explicit pvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator(type_handle)) { }
   pvector(const pvector<Type> &copy) : base_class(copy) { }
   pvector(const pvector<Type> &copy) : base_class(copy) { }
+  pvector(pvector<Type> &&from) noexcept : base_class(move(from)) {};
   explicit pvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator(type_handle)) { }
   explicit pvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator(type_handle)) { }
   explicit pvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator(type_handle)) { }
   explicit pvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator(type_handle)) { }
   pvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator(type_handle)) { }
   pvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator(type_handle)) { }
 
 
-#ifdef USE_MOVE_SEMANTICS
-  pvector(pvector<Type> &&from) NOEXCEPT : base_class(move(from)) {};
-
-  pvector<Type> &operator =(pvector<Type> &&from) NOEXCEPT {
-    base_class::operator =(move(from));
+  pvector<Type> &operator =(const pvector<Type> &copy) {
+    base_class::operator =(copy);
     return *this;
     return *this;
   }
   }
-#endif
 
 
-  pvector<Type> &operator =(const pvector<Type> &copy) {
-    base_class::operator =(copy);
+  pvector<Type> &operator =(pvector<Type> &&from) noexcept {
+    base_class::operator =(move(from));
     return *this;
     return *this;
   }
   }
 };
 };

+ 1 - 20
dtool/src/dtoolbase/typeHandle.I

@@ -191,14 +191,6 @@ output(ostream &out) const {
   out << get_name();
   out << get_name();
 }
 }
 
 
-/**
- * Returns a special zero-valued TypeHandle that is used to indicate no type.
- */
-CONSTEXPR TypeHandle TypeHandle::
-none() {
-  return TypeHandle(0);
-}
-
 /**
 /**
  * TypeHandle::none() evaluates to false, everything else evaluates to true.
  * TypeHandle::none() evaluates to false, everything else evaluates to true.
  */
  */
@@ -207,21 +199,10 @@ operator bool () const {
   return (_index != 0);
   return (_index != 0);
 }
 }
 
 
-/**
- * Creates a TypeHandle from a type index without error checking, for use by
- * internal functions.
- *
- * See TypeRegistry::find_type_by_id().
- */
-CONSTEXPR TypeHandle TypeHandle::
-from_index(int index) {
-  return TypeHandle(index);
-}
-
 /**
 /**
  * Private constructor for initializing a TypeHandle from an index, used by
  * Private constructor for initializing a TypeHandle from an index, used by
  * none() and by from_index().
  * none() and by from_index().
  */
  */
-CONSTEXPR TypeHandle::
+constexpr TypeHandle::
 TypeHandle(int index) : _index(index) {
 TypeHandle(int index) : _index(index) {
 }
 }

+ 5 - 5
dtool/src/dtoolbase/typeHandle.h

@@ -78,9 +78,9 @@ class TypedObject;
  * that ancestry of a particular type may be queried, and the type name may be
  * that ancestry of a particular type may be queried, and the type name may be
  * retrieved for run-time display.
  * retrieved for run-time display.
  */
  */
-class EXPCL_DTOOL_DTOOLBASE TypeHandle FINAL {
+class EXPCL_DTOOL_DTOOLBASE TypeHandle final {
 PUBLISHED:
 PUBLISHED:
-  TypeHandle() NOEXCEPT DEFAULT_CTOR;
+  TypeHandle() noexcept = default;
 
 
   enum MemoryClass {
   enum MemoryClass {
     MC_singleton,
     MC_singleton,
@@ -129,7 +129,7 @@ PUBLISHED:
 
 
   INLINE int get_index() const;
   INLINE int get_index() const;
   INLINE void output(ostream &out) const;
   INLINE void output(ostream &out) const;
-  CONSTEXPR static TypeHandle none();
+  constexpr static TypeHandle none() { return TypeHandle(0); }
   INLINE operator bool () const;
   INLINE operator bool () const;
 
 
   MAKE_PROPERTY(index, get_index);
   MAKE_PROPERTY(index, get_index);
@@ -142,10 +142,10 @@ public:
   void *reallocate_array(void *ptr, size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
   void *reallocate_array(void *ptr, size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
   void deallocate_array(void *ptr);
   void deallocate_array(void *ptr);
 
 
-  CONSTEXPR static TypeHandle from_index(int index);
+  constexpr static TypeHandle from_index(int index) { return TypeHandle(index); }
 
 
 private:
 private:
-  CONSTEXPR TypeHandle(int index);
+  constexpr TypeHandle(int index);
 
 
   // Only kept temporarily for ABI compatibility.
   // Only kept temporarily for ABI compatibility.
   static TypeHandle _none;
   static TypeHandle _none;

+ 44 - 44
dtool/src/dtoolbase/typeRegistry.cxx

@@ -32,7 +32,7 @@ TypeRegistry *TypeRegistry::_global_pointer = NULL;
  */
  */
 bool TypeRegistry::
 bool TypeRegistry::
 register_type(TypeHandle &type_handle, const string &name) {
 register_type(TypeHandle &type_handle, const string &name) {
-  _lock->acquire();
+  _lock->lock();
 
 
   if (type_handle != TypeHandle::none()) {
   if (type_handle != TypeHandle::none()) {
     // Here's a type that was already registered.  Just make sure everything's
     // Here's a type that was already registered.  Just make sure everything's
@@ -40,7 +40,7 @@ register_type(TypeHandle &type_handle, const string &name) {
     TypeRegistryNode *rnode = look_up(type_handle, NULL);
     TypeRegistryNode *rnode = look_up(type_handle, NULL);
     if (&type_handle == &rnode->_ref) {
     if (&type_handle == &rnode->_ref) {
       // No problem.
       // No problem.
-      _lock->release();
+      _lock->unlock();
       assert(rnode->_name == name);
       assert(rnode->_name == name);
       return false;
       return false;
     }
     }
@@ -62,7 +62,7 @@ register_type(TypeHandle &type_handle, const string &name) {
     _derivations_fresh = false;
     _derivations_fresh = false;
 
 
     type_handle = new_handle;
     type_handle = new_handle;
-    _lock->release();
+    _lock->unlock();
     return true;
     return true;
   }
   }
   TypeRegistryNode *rnode = (*ri).second;
   TypeRegistryNode *rnode = (*ri).second;
@@ -78,7 +78,7 @@ register_type(TypeHandle &type_handle, const string &name) {
 
 
     if (type_handle == rnode->_handle) {
     if (type_handle == rnode->_handle) {
       // No problem.
       // No problem.
-      _lock->release();
+      _lock->unlock();
       return false;
       return false;
     }
     }
     // But wait--the type_handle has changed!  We kept a reference to the
     // But wait--the type_handle has changed!  We kept a reference to the
@@ -87,7 +87,7 @@ register_type(TypeHandle &type_handle, const string &name) {
     // time, but now it's different!  Bad juju.
     // time, but now it's different!  Bad juju.
     cerr << "Reregistering " << name << "\n";
     cerr << "Reregistering " << name << "\n";
     type_handle = rnode->_handle;
     type_handle = rnode->_handle;
-    _lock->release();
+    _lock->unlock();
     return false;
     return false;
   }
   }
 
 
@@ -103,7 +103,7 @@ register_type(TypeHandle &type_handle, const string &name) {
 
 
     type_handle = rnode->_handle;
     type_handle = rnode->_handle;
   }
   }
-  _lock->release();
+  _lock->unlock();
   return false;
   return false;
 }
 }
 
 
@@ -114,7 +114,7 @@ register_type(TypeHandle &type_handle, const string &name) {
  */
  */
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 register_dynamic_type(const string &name) {
 register_dynamic_type(const string &name) {
-  _lock->acquire();
+  _lock->lock();
 
 
   NameRegistry::iterator ri;
   NameRegistry::iterator ri;
   ri = _name_registry.find(name);
   ri = _name_registry.find(name);
@@ -134,14 +134,14 @@ register_dynamic_type(const string &name) {
     _name_registry[name] = rnode;
     _name_registry[name] = rnode;
     _derivations_fresh = false;
     _derivations_fresh = false;
 
 
-    _lock->release();
+    _lock->unlock();
     return *new_handle;
     return *new_handle;
   }
   }
 
 
   // Return the TypeHandle previously obtained.
   // Return the TypeHandle previously obtained.
   TypeRegistryNode *rnode = (*ri).second;
   TypeRegistryNode *rnode = (*ri).second;
   TypeHandle handle = rnode->_handle;
   TypeHandle handle = rnode->_handle;
-  _lock->release();
+  _lock->unlock();
   return handle;
   return handle;
 }
 }
 
 
@@ -152,7 +152,7 @@ register_dynamic_type(const string &name) {
  */
  */
 void TypeRegistry::
 void TypeRegistry::
 record_derivation(TypeHandle child, TypeHandle parent) {
 record_derivation(TypeHandle child, TypeHandle parent) {
-  _lock->acquire();
+  _lock->lock();
 
 
   TypeRegistryNode *cnode = look_up(child, NULL);
   TypeRegistryNode *cnode = look_up(child, NULL);
   assert(cnode != (TypeRegistryNode *)NULL);
   assert(cnode != (TypeRegistryNode *)NULL);
@@ -171,7 +171,7 @@ record_derivation(TypeHandle child, TypeHandle parent) {
     _derivations_fresh = false;
     _derivations_fresh = false;
   }
   }
 
 
-  _lock->release();
+  _lock->unlock();
 }
 }
 
 
 /**
 /**
@@ -182,7 +182,7 @@ record_derivation(TypeHandle child, TypeHandle parent) {
  */
  */
 void TypeRegistry::
 void TypeRegistry::
 record_alternate_name(TypeHandle type, const string &name) {
 record_alternate_name(TypeHandle type, const string &name) {
-  _lock->acquire();
+  _lock->lock();
 
 
   TypeRegistryNode *rnode = look_up(type, (TypedObject *)NULL);
   TypeRegistryNode *rnode = look_up(type, (TypedObject *)NULL);
   if (rnode != (TypeRegistryNode *)NULL) {
   if (rnode != (TypeRegistryNode *)NULL) {
@@ -190,7 +190,7 @@ record_alternate_name(TypeHandle type, const string &name) {
       _name_registry.insert(NameRegistry::value_type(name, rnode)).first;
       _name_registry.insert(NameRegistry::value_type(name, rnode)).first;
 
 
     if ((*ri).second != rnode) {
     if ((*ri).second != rnode) {
-      _lock->release();
+      _lock->unlock();
       cerr
       cerr
         << "Name " << name << " already assigned to TypeHandle "
         << "Name " << name << " already assigned to TypeHandle "
         << rnode->_name << "; cannot reassign to " << type << "\n";
         << rnode->_name << "; cannot reassign to " << type << "\n";
@@ -199,7 +199,7 @@ record_alternate_name(TypeHandle type, const string &name) {
 
 
   }
   }
 
 
-  _lock->release();
+  _lock->unlock();
 }
 }
 
 
 /**
 /**
@@ -208,7 +208,7 @@ record_alternate_name(TypeHandle type, const string &name) {
  */
  */
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 find_type(const string &name) const {
 find_type(const string &name) const {
-  _lock->acquire();
+  _lock->lock();
 
 
   TypeHandle handle = TypeHandle::none();
   TypeHandle handle = TypeHandle::none();
   NameRegistry::const_iterator ri;
   NameRegistry::const_iterator ri;
@@ -216,7 +216,7 @@ find_type(const string &name) const {
   if (ri != _name_registry.end()) {
   if (ri != _name_registry.end()) {
     handle = (*ri).second->_handle;
     handle = (*ri).second->_handle;
   }
   }
-  _lock->release();
+  _lock->unlock();
 
 
   return handle;
   return handle;
 }
 }
@@ -248,11 +248,11 @@ find_type_by_id(int id) const {
  */
  */
 string TypeRegistry::
 string TypeRegistry::
 get_name(TypeHandle type, TypedObject *object) const {
 get_name(TypeHandle type, TypedObject *object) const {
-  _lock->acquire();
+  _lock->lock();
   TypeRegistryNode *rnode = look_up(type, object);
   TypeRegistryNode *rnode = look_up(type, object);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
   string name = rnode->_name;
   string name = rnode->_name;
-  _lock->release();
+  _lock->unlock();
 
 
   return name;
   return name;
 }
 }
@@ -273,7 +273,7 @@ get_name(TypeHandle type, TypedObject *object) const {
 bool TypeRegistry::
 bool TypeRegistry::
 is_derived_from(TypeHandle child, TypeHandle base,
 is_derived_from(TypeHandle child, TypeHandle base,
                 TypedObject *child_object) {
                 TypedObject *child_object) {
-  _lock->acquire();
+  _lock->lock();
 
 
   const TypeRegistryNode *child_node = look_up(child, child_object);
   const TypeRegistryNode *child_node = look_up(child, child_object);
   const TypeRegistryNode *base_node = look_up(base, (TypedObject *)NULL);
   const TypeRegistryNode *base_node = look_up(base, (TypedObject *)NULL);
@@ -284,7 +284,7 @@ is_derived_from(TypeHandle child, TypeHandle base,
   freshen_derivations();
   freshen_derivations();
 
 
   bool result = TypeRegistryNode::is_derived_from(child_node, base_node);
   bool result = TypeRegistryNode::is_derived_from(child_node, base_node);
-  _lock->release();
+  _lock->unlock();
   return result;
   return result;
 }
 }
 
 
@@ -293,9 +293,9 @@ is_derived_from(TypeHandle child, TypeHandle base,
  */
  */
 int TypeRegistry::
 int TypeRegistry::
 get_num_typehandles() {
 get_num_typehandles() {
-  _lock->acquire();
+  _lock->lock();
   int num_types = (int)_handle_registry.size();
   int num_types = (int)_handle_registry.size();
-  _lock->release();
+  _lock->unlock();
   return num_types;
   return num_types;
 }
 }
 
 
@@ -304,12 +304,12 @@ get_num_typehandles() {
  */
  */
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 get_typehandle(int n) {
 get_typehandle(int n) {
-  _lock->acquire();
+  _lock->lock();
   TypeRegistryNode *rnode = NULL;
   TypeRegistryNode *rnode = NULL;
   if (n >= 0 && n < (int)_handle_registry.size()) {
   if (n >= 0 && n < (int)_handle_registry.size()) {
     rnode = _handle_registry[n];
     rnode = _handle_registry[n];
   }
   }
-  _lock->release();
+  _lock->unlock();
 
 
   if (rnode != (TypeRegistryNode *)NULL) {
   if (rnode != (TypeRegistryNode *)NULL) {
     return rnode->_handle;
     return rnode->_handle;
@@ -324,10 +324,10 @@ get_typehandle(int n) {
  */
  */
 int TypeRegistry::
 int TypeRegistry::
 get_num_root_classes() {
 get_num_root_classes() {
-  _lock->acquire();
+  _lock->lock();
   freshen_derivations();
   freshen_derivations();
   int num_roots = (int)_root_classes.size();
   int num_roots = (int)_root_classes.size();
-  _lock->release();
+  _lock->unlock();
   return num_roots;
   return num_roots;
 }
 }
 
 
@@ -336,7 +336,7 @@ get_num_root_classes() {
  */
  */
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 get_root_class(int n) {
 get_root_class(int n) {
-  _lock->acquire();
+  _lock->lock();
   freshen_derivations();
   freshen_derivations();
   TypeHandle handle;
   TypeHandle handle;
   if (n >= 0 && n < (int)_root_classes.size()) {
   if (n >= 0 && n < (int)_root_classes.size()) {
@@ -344,7 +344,7 @@ get_root_class(int n) {
   } else {
   } else {
     handle = TypeHandle::none();
     handle = TypeHandle::none();
   }
   }
-  _lock->release();
+  _lock->unlock();
 
 
   return handle;
   return handle;
 }
 }
@@ -362,11 +362,11 @@ get_root_class(int n) {
  */
  */
 int TypeRegistry::
 int TypeRegistry::
 get_num_parent_classes(TypeHandle child, TypedObject *child_object) const {
 get_num_parent_classes(TypeHandle child, TypedObject *child_object) const {
-  _lock->acquire();
+  _lock->lock();
   TypeRegistryNode *rnode = look_up(child, child_object);
   TypeRegistryNode *rnode = look_up(child, child_object);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
   int num_parents = (int)rnode->_parent_classes.size();
   int num_parents = (int)rnode->_parent_classes.size();
-  _lock->release();
+  _lock->unlock();
   return num_parents;
   return num_parents;
 }
 }
 
 
@@ -376,7 +376,7 @@ get_num_parent_classes(TypeHandle child, TypedObject *child_object) const {
  */
  */
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 get_parent_class(TypeHandle child, int index) const {
 get_parent_class(TypeHandle child, int index) const {
-  _lock->acquire();
+  _lock->lock();
   TypeHandle handle;
   TypeHandle handle;
   TypeRegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   TypeRegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
@@ -385,7 +385,7 @@ get_parent_class(TypeHandle child, int index) const {
   } else {
   } else {
     handle = TypeHandle::none();
     handle = TypeHandle::none();
   }
   }
-  _lock->release();
+  _lock->unlock();
   return handle;
   return handle;
 }
 }
 
 
@@ -399,11 +399,11 @@ get_parent_class(TypeHandle child, int index) const {
  */
  */
 int TypeRegistry::
 int TypeRegistry::
 get_num_child_classes(TypeHandle child, TypedObject *child_object) const {
 get_num_child_classes(TypeHandle child, TypedObject *child_object) const {
-  _lock->acquire();
+  _lock->lock();
   TypeRegistryNode *rnode = look_up(child, child_object);
   TypeRegistryNode *rnode = look_up(child, child_object);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
   int num_children = (int)rnode->_child_classes.size();
   int num_children = (int)rnode->_child_classes.size();
-  _lock->release();
+  _lock->unlock();
   return num_children;
   return num_children;
 }
 }
 
 
@@ -413,7 +413,7 @@ get_num_child_classes(TypeHandle child, TypedObject *child_object) const {
  */
  */
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 get_child_class(TypeHandle child, int index) const {
 get_child_class(TypeHandle child, int index) const {
-  _lock->acquire();
+  _lock->lock();
   TypeHandle handle;
   TypeHandle handle;
   TypeRegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   TypeRegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
@@ -422,7 +422,7 @@ get_child_class(TypeHandle child, int index) const {
   } else {
   } else {
     handle = TypeHandle::none();
     handle = TypeHandle::none();
   }
   }
-  _lock->release();
+  _lock->unlock();
   return handle;
   return handle;
 }
 }
 
 
@@ -439,7 +439,7 @@ get_child_class(TypeHandle child, int index) const {
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 get_parent_towards(TypeHandle child, TypeHandle base,
 get_parent_towards(TypeHandle child, TypeHandle base,
                    TypedObject *child_object) {
                    TypedObject *child_object) {
-  _lock->acquire();
+  _lock->lock();
   TypeHandle handle;
   TypeHandle handle;
   const TypeRegistryNode *child_node = look_up(child, child_object);
   const TypeRegistryNode *child_node = look_up(child, child_object);
   const TypeRegistryNode *base_node = look_up(base, NULL);
   const TypeRegistryNode *base_node = look_up(base, NULL);
@@ -447,7 +447,7 @@ get_parent_towards(TypeHandle child, TypeHandle base,
          base_node != (TypeRegistryNode *)NULL);
          base_node != (TypeRegistryNode *)NULL);
   freshen_derivations();
   freshen_derivations();
   handle = TypeRegistryNode::get_parent_towards(child_node, base_node);
   handle = TypeRegistryNode::get_parent_towards(child_node, base_node);
-  _lock->release();
+  _lock->unlock();
   return handle;
   return handle;
 }
 }
 
 
@@ -462,7 +462,7 @@ get_parent_towards(TypeHandle child, TypeHandle base,
 void TypeRegistry::
 void TypeRegistry::
 reregister_types() {
 reregister_types() {
   init_lock();
   init_lock();
-  _lock->acquire();
+  _lock->lock();
   HandleRegistry::iterator ri;
   HandleRegistry::iterator ri;
   TypeRegistry *reg = ptr();
   TypeRegistry *reg = ptr();
   for (ri = reg->_handle_registry.begin();
   for (ri = reg->_handle_registry.begin();
@@ -473,7 +473,7 @@ reregister_types() {
       cerr << "Reregistering " << rnode->_name << "\n";
       cerr << "Reregistering " << rnode->_name << "\n";
     }
     }
   }
   }
-  _lock->release();
+  _lock->unlock();
 }
 }
 
 
 
 
@@ -483,9 +483,9 @@ reregister_types() {
  */
  */
 void TypeRegistry::
 void TypeRegistry::
 write(ostream &out) const {
 write(ostream &out) const {
-  _lock->acquire();
+  _lock->lock();
   do_write(out);
   do_write(out);
-  _lock->release();
+  _lock->unlock();
 }
 }
 
 
 /**
 /**
@@ -613,9 +613,9 @@ look_up_invalid(TypeHandle handle, TypedObject *object) const {
       // But we're lucky enough to have a TypedObject pointer handy!  Maybe we
       // But we're lucky enough to have a TypedObject pointer handy!  Maybe we
       // can use it to resolve the error.  We have to drop the lock while we
       // can use it to resolve the error.  We have to drop the lock while we
       // do this, so we don't get a recursive lock.
       // do this, so we don't get a recursive lock.
-      _lock->release();
+      _lock->unlock();
       handle = object->force_init_type();
       handle = object->force_init_type();
-      _lock->acquire();
+      _lock->lock();
 
 
       if (handle._index == 0) {
       if (handle._index == 0) {
         // Strange.
         // Strange.

+ 3 - 3
dtool/src/dtoolbase/typedObject.h

@@ -87,9 +87,9 @@
  */
  */
 class EXPCL_DTOOL_DTOOLBASE TypedObject : public MemoryBase {
 class EXPCL_DTOOL_DTOOLBASE TypedObject : public MemoryBase {
 public:
 public:
-  INLINE TypedObject() DEFAULT_CTOR;
-  INLINE TypedObject(const TypedObject &copy) DEFAULT_CTOR;
-  INLINE TypedObject &operator = (const TypedObject &copy) DEFAULT_ASSIGN;
+  INLINE TypedObject() = default;
+  INLINE TypedObject(const TypedObject &copy) = default;
+  INLINE TypedObject &operator = (const TypedObject &copy) = default;
 
 
 PUBLISHED:
 PUBLISHED:
   // A virtual destructor is just a good idea.
   // A virtual destructor is just a good idea.

+ 8 - 17
dtool/src/dtoolutil/filename.I

@@ -54,24 +54,20 @@ Filename(const Filename &copy) :
 {
 {
 }
 }
 
 
-#ifdef USE_MOVE_SEMANTICS
 /**
 /**
  *
  *
  */
  */
 INLINE Filename::
 INLINE Filename::
-Filename(string &&filename) NOEXCEPT {
-  _flags = 0;
-  (*this) = move(filename);
+Filename(string &&filename) noexcept : _flags(0) {
+  (*this) = std::move(filename);
 }
 }
-#endif  // USE_MOVE_SEMANTICS
 
 
-#ifdef USE_MOVE_SEMANTICS
 /**
 /**
  *
  *
  */
  */
 INLINE Filename::
 INLINE Filename::
-Filename(Filename &&from) NOEXCEPT :
-  _filename(move(from._filename)),
+Filename(Filename &&from) noexcept :
+  _filename(std::move(from._filename)),
   _dirname_end(from._dirname_end),
   _dirname_end(from._dirname_end),
   _basename_start(from._basename_start),
   _basename_start(from._basename_start),
   _basename_end(from._basename_end),
   _basename_end(from._basename_end),
@@ -81,7 +77,6 @@ Filename(Filename &&from) NOEXCEPT :
   _flags(from._flags)
   _flags(from._flags)
 {
 {
 }
 }
-#endif  // USE_MOVE_SEMANTICS
 
 
 /**
 /**
  * Creates an empty Filename.
  * Creates an empty Filename.
@@ -217,28 +212,25 @@ operator = (const Filename &copy) {
   return *this;
   return *this;
 }
 }
 
 
-#ifdef USE_MOVE_SEMANTICS
 /**
 /**
  *
  *
  */
  */
 INLINE Filename &Filename::
 INLINE Filename &Filename::
-operator = (string &&filename) NOEXCEPT {
-  _filename = move(filename);
+operator = (string &&filename) noexcept {
+  _filename = std::move(filename);
 
 
   locate_basename();
   locate_basename();
   locate_extension();
   locate_extension();
   locate_hash();
   locate_hash();
   return *this;
   return *this;
 }
 }
-#endif  // USE_MOVE_SEMANTICS
 
 
-#ifdef USE_MOVE_SEMANTICS
 /**
 /**
  *
  *
  */
  */
 INLINE Filename &Filename::
 INLINE Filename &Filename::
-operator = (Filename &&from) NOEXCEPT {
-  _filename = move(from._filename);
+operator = (Filename &&from) noexcept {
+  _filename = std::move(from._filename);
   _dirname_end = from._dirname_end;
   _dirname_end = from._dirname_end;
   _basename_start = from._basename_start;
   _basename_start = from._basename_start;
   _basename_end = from._basename_end;
   _basename_end = from._basename_end;
@@ -248,7 +240,6 @@ operator = (Filename &&from) NOEXCEPT {
   _flags = from._flags;
   _flags = from._flags;
   return *this;
   return *this;
 }
 }
-#endif  // USE_MOVE_SEMANTICS
 
 
 /**
 /**
  *
  *

+ 3 - 3
dtool/src/dtoolutil/filename.cxx

@@ -48,7 +48,7 @@
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
-#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
+#if defined(__ANDROID__) && !defined(PHAVE_LOCKF)
 // Needed for flock.
 // Needed for flock.
 #include <sys/file.h>
 #include <sys/file.h>
 #endif
 #endif
@@ -2752,7 +2752,7 @@ atomic_compare_and_exchange_contents(string &orig_contents,
 
 
   orig_contents = string();
   orig_contents = string();
 
 
-#ifdef HAVE_LOCKF
+#ifdef PHAVE_LOCKF
   if (lockf(fd, F_LOCK, 0) != 0) {
   if (lockf(fd, F_LOCK, 0) != 0) {
 #else
 #else
   if (flock(fd, LOCK_EX) != 0) {
   if (flock(fd, LOCK_EX) != 0) {
@@ -2868,7 +2868,7 @@ atomic_read_contents(string &contents) const {
 
 
   contents = string();
   contents = string();
 
 
-#ifdef HAVE_LOCKF
+#ifdef PHAVE_LOCKF
   if (lockf(fd, F_LOCK, 0) != 0) {
   if (lockf(fd, F_LOCK, 0) != 0) {
 #else
 #else
   if (flock(fd, LOCK_EX) != 0) {
   if (flock(fd, LOCK_EX) != 0) {

+ 4 - 10
dtool/src/dtoolutil/filename.h

@@ -58,11 +58,8 @@ public:
   INLINE Filename(const string &filename);
   INLINE Filename(const string &filename);
   INLINE Filename(const wstring &filename);
   INLINE Filename(const wstring &filename);
   INLINE Filename(const Filename &copy);
   INLINE Filename(const Filename &copy);
-
-#ifdef USE_MOVE_SEMANTICS
-  INLINE Filename(string &&filename) NOEXCEPT;
-  INLINE Filename(Filename &&from) NOEXCEPT;
-#endif
+  INLINE Filename(string &&filename) noexcept;
+  INLINE Filename(Filename &&from) noexcept;
 
 
 PUBLISHED:
 PUBLISHED:
   INLINE Filename();
   INLINE Filename();
@@ -106,11 +103,8 @@ PUBLISHED:
   INLINE Filename &operator = (const wstring &filename);
   INLINE Filename &operator = (const wstring &filename);
   INLINE Filename &operator = (const char *filename);
   INLINE Filename &operator = (const char *filename);
   INLINE Filename &operator = (const Filename &copy);
   INLINE Filename &operator = (const Filename &copy);
-
-#ifdef USE_MOVE_SEMANTICS
-  INLINE Filename &operator = (string &&filename) NOEXCEPT;
-  INLINE Filename &operator = (Filename &&from) NOEXCEPT;
-#endif
+  INLINE Filename &operator = (string &&filename) noexcept;
+  INLINE Filename &operator = (Filename &&from) noexcept;
 
 
   // And retrieval is by any of the classic string operations.
   // And retrieval is by any of the classic string operations.
   INLINE operator const string & () const;
   INLINE operator const string & () const;

+ 0 - 2
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -2601,7 +2601,6 @@ write_module_class(ostream &out, Object *obj) {
       // compare_to function, which is mapped to the tp_compare slot, which
       // compare_to function, which is mapped to the tp_compare slot, which
       // Python 3 no longer has.  So, we'll write code to fall back to that if
       // Python 3 no longer has.  So, we'll write code to fall back to that if
       // no matching comparison operator was found.
       // no matching comparison operator was found.
-      out << "#if PY_MAJOR_VERSION >= 3\n";
       out << "  // All is not lost; we still have the compare_to function to fall back onto.\n";
       out << "  // All is not lost; we still have the compare_to function to fall back onto.\n";
       out << "  int cmpval = " << slots["tp_compare"]._wrapper_name << "(self, arg);\n";
       out << "  int cmpval = " << slots["tp_compare"]._wrapper_name << "(self, arg);\n";
       out << "  if (cmpval == -1 && _PyErr_OCCURRED()) {\n";
       out << "  if (cmpval == -1 && _PyErr_OCCURRED()) {\n";
@@ -2625,7 +2624,6 @@ write_module_class(ostream &out, Object *obj) {
       out << "  case Py_GE:\n";
       out << "  case Py_GE:\n";
       out << "    return PyBool_FromLong(cmpval >= 0);\n";
       out << "    return PyBool_FromLong(cmpval >= 0);\n";
       out << "  }\n";
       out << "  }\n";
-      out << "#endif\n\n";
     }
     }
 
 
     out << "  Py_INCREF(Py_NotImplemented);\n";
     out << "  Py_INCREF(Py_NotImplemented);\n";

+ 2 - 2
dtool/src/prc/configVariableFilename.cxx

@@ -23,7 +23,7 @@ reload_cache() {
   // thread-safe manner.  But chances are that the first time this is called
   // thread-safe manner.  But chances are that the first time this is called
   // is at static init time, when there is no risk of data races.
   // is at static init time, when there is no risk of data races.
   static MutexImpl lock;
   static MutexImpl lock;
-  lock.acquire();
+  lock.lock();
 
 
   // We check again for cache validity since another thread may have beaten
   // We check again for cache validity since another thread may have beaten
   // us to the punch while we were waiting for the lock.
   // us to the punch while we were waiting for the lock.
@@ -42,5 +42,5 @@ reload_cache() {
 
 
     mark_cache_valid(_local_modified);
     mark_cache_valid(_local_modified);
   }
   }
-  lock.release();
+  lock.unlock();
 }
 }

+ 2 - 2
dtool/src/prc/configVariableString.cxx

@@ -22,7 +22,7 @@ reload_cache() {
   // thread-safe manner.  But chances are that the first time this is called
   // thread-safe manner.  But chances are that the first time this is called
   // is at static init time, when there is no risk of data races.
   // is at static init time, when there is no risk of data races.
   static MutexImpl lock;
   static MutexImpl lock;
-  lock.acquire();
+  lock.lock();
 
 
   // We check again for cache validity since another thread may have beaten
   // We check again for cache validity since another thread may have beaten
   // us to the punch while we were waiting for the lock.
   // us to the punch while we were waiting for the lock.
@@ -31,5 +31,5 @@ reload_cache() {
     mark_cache_valid(_local_modified);
     mark_cache_valid(_local_modified);
   }
   }
 
 
-  lock.release();
+  lock.unlock();
 }
 }

+ 2 - 2
dtool/src/prc/notifyCategory.I

@@ -88,7 +88,7 @@ is_debug() const {
  * "debug" severities, and these methods are redefined to be static to make it
  * "debug" severities, and these methods are redefined to be static to make it
  * more obvious to the compiler.
  * more obvious to the compiler.
  */
  */
-CONSTEXPR bool NotifyCategory::
+constexpr bool NotifyCategory::
 is_spam() {
 is_spam() {
   return false;
   return false;
 }
 }
@@ -98,7 +98,7 @@ is_spam() {
  * "debug" severities, and these methods are redefined to be static to make it
  * "debug" severities, and these methods are redefined to be static to make it
  * more obvious to the compiler.
  * more obvious to the compiler.
  */
  */
-CONSTEXPR bool NotifyCategory::
+constexpr bool NotifyCategory::
 is_debug() {
 is_debug() {
   return false;
   return false;
 }
 }

+ 2 - 2
dtool/src/prc/notifyCategory.h

@@ -55,8 +55,8 @@ PUBLISHED:
   INLINE bool is_spam() const;
   INLINE bool is_spam() const;
   INLINE bool is_debug() const;
   INLINE bool is_debug() const;
 #else
 #else
-  CONSTEXPR static bool is_spam();
-  CONSTEXPR static bool is_debug();
+  constexpr static bool is_spam();
+  constexpr static bool is_debug();
 #endif
 #endif
   INLINE bool is_info() const;
   INLINE bool is_info() const;
   INLINE bool is_warning() const;
   INLINE bool is_warning() const;

+ 2 - 2
dtool/src/prc/notifyCategoryProxy.I

@@ -74,7 +74,7 @@ is_spam() {
 }
 }
 #else
 #else
 template<class GetCategory>
 template<class GetCategory>
-CONSTEXPR bool NotifyCategoryProxy<GetCategory>::
+constexpr bool NotifyCategoryProxy<GetCategory>::
 is_spam() {
 is_spam() {
   return false;
   return false;
 }
 }
@@ -92,7 +92,7 @@ is_debug() {
 }
 }
 #else
 #else
 template<class GetCategory>
 template<class GetCategory>
-CONSTEXPR bool NotifyCategoryProxy<GetCategory>::
+constexpr bool NotifyCategoryProxy<GetCategory>::
 is_debug() {
 is_debug() {
   return false;
   return false;
 }
 }

+ 2 - 2
dtool/src/prc/notifyCategoryProxy.h

@@ -75,8 +75,8 @@ public:
   INLINE bool is_spam();
   INLINE bool is_spam();
   INLINE bool is_debug();
   INLINE bool is_debug();
 #else
 #else
-  CONSTEXPR static bool is_spam();
-  CONSTEXPR static bool is_debug();
+  constexpr static bool is_spam();
+  constexpr static bool is_debug();
 #endif
 #endif
   INLINE bool is_info();
   INLINE bool is_info();
   INLINE bool is_warning();
   INLINE bool is_warning();

+ 2 - 2
dtool/src/prc/streamWrapper.I

@@ -36,7 +36,7 @@ StreamWrapperBase() {
  */
  */
 INLINE void StreamWrapperBase::
 INLINE void StreamWrapperBase::
 acquire() {
 acquire() {
-  _lock.acquire();
+  _lock.lock();
 #ifdef SIMPLE_THREADS
 #ifdef SIMPLE_THREADS
   while (_lock_flag) {
   while (_lock_flag) {
     thread_yield();
     thread_yield();
@@ -55,7 +55,7 @@ release() {
   assert(_lock_flag);
   assert(_lock_flag);
   _lock_flag = false;
   _lock_flag = false;
 #endif
 #endif
-  _lock.release();
+  _lock.unlock();
 }
 }
 
 
 /**
 /**

+ 1 - 3
dtool/src/prc/streamWrapper.h

@@ -24,9 +24,7 @@
 class EXPCL_DTOOL_PRC StreamWrapperBase {
 class EXPCL_DTOOL_PRC StreamWrapperBase {
 protected:
 protected:
   INLINE StreamWrapperBase();
   INLINE StreamWrapperBase();
-
-private:
-  INLINE StreamWrapperBase(const StreamWrapperBase &copy) DELETED;
+  INLINE StreamWrapperBase(const StreamWrapperBase &copy) = delete;
 
 
 PUBLISHED:
 PUBLISHED:
   INLINE void acquire();
   INLINE void acquire();

+ 18 - 22
makepanda/makepanda.py

@@ -315,9 +315,7 @@ def parseopts(args):
         usage("Invalid SHA-1 hash given for --git-commit option!")
         usage("Invalid SHA-1 hash given for --git-commit option!")
 
 
     if GetTarget() == 'windows':
     if GetTarget() == 'windows':
-        show_warning = False
         if not MSVC_VERSION:
         if not MSVC_VERSION:
-            show_warning = True
             print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
             print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
             MSVC_VERSION = (14, 0)
             MSVC_VERSION = (14, 0)
         else:
         else:
@@ -325,22 +323,19 @@ def parseopts(args):
                 MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
                 MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
                 if (len(MSVC_VERSION) == 1):
                 if (len(MSVC_VERSION) == 1):
                     MSVC_VERSION += (0,)
                     MSVC_VERSION += (0,)
-                if MSVC_VERSION < (14, 0):
-                    show_warning = True
             except:
             except:
                 usage("Invalid setting for --msvc-version")
                 usage("Invalid setting for --msvc-version")
 
 
-        if show_warning:
-            warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
+        if MSVC_VERSION < (14, 0):
+            warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
             print("=========================================================================")
             print("=========================================================================")
-            print(warn_prefix + "Support for MSVC versions before 2015 will soon be discontinued.")
-            print(warn_prefix + "If you wish to keep using MSVC 2010, make your voice heard at:")
+            print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
+            print(warn_prefix + "For more information, or any questions, please visit:")
             print(warn_prefix + "  https://github.com/panda3d/panda3d/issues/288")
             print(warn_prefix + "  https://github.com/panda3d/panda3d/issues/288")
-            if MSVC_VERSION >= (14, 0):
-                print(warn_prefix + "To squelch this warning, pass --msvc-version {0}.{1}".format(*MSVC_VERSION))
             print("=========================================================================")
             print("=========================================================================")
             sys.stdout.flush()
             sys.stdout.flush()
             time.sleep(1.0)
             time.sleep(1.0)
+            sys.exit(1)
 
 
         if not WINDOWS_SDK:
         if not WINDOWS_SDK:
             print("No Windows SDK version specified. Defaulting to '7.1'.")
             print("No Windows SDK version specified. Defaulting to '7.1'.")
@@ -2272,12 +2267,10 @@ DTOOL_CONFIG=[
     ("DO_PIPELINING",                  '1',                      '1'),
     ("DO_PIPELINING",                  '1',                      '1'),
     ("DEFAULT_PATHSEP",                '";"',                    '":"'),
     ("DEFAULT_PATHSEP",                '";"',                    '":"'),
     ("WORDS_BIGENDIAN",                'UNDEF',                  'UNDEF'),
     ("WORDS_BIGENDIAN",                'UNDEF',                  'UNDEF'),
-    ("HAVE_NAMESPACE",                 '1',                      '1'),
     ("HAVE_OPEN_MASK",                 'UNDEF',                  'UNDEF'),
     ("HAVE_OPEN_MASK",                 'UNDEF',                  'UNDEF'),
-    ("HAVE_LOCKF",                     '1',                      '1'),
+    ("PHAVE_LOCKF",                     '1',                      '1'),
     ("HAVE_WCHAR_T",                   '1',                      '1'),
     ("HAVE_WCHAR_T",                   '1',                      '1'),
     ("HAVE_WSTRING",                   '1',                      '1'),
     ("HAVE_WSTRING",                   '1',                      '1'),
-    ("HAVE_TYPENAME",                  '1',                      '1'),
     ("SIMPLE_STRUCT_POINTERS",         '1',                      'UNDEF'),
     ("SIMPLE_STRUCT_POINTERS",         '1',                      'UNDEF'),
     ("HAVE_DINKUM",                    'UNDEF',                  'UNDEF'),
     ("HAVE_DINKUM",                    'UNDEF',                  'UNDEF'),
     ("HAVE_STL_HASH",                  'UNDEF',                  'UNDEF'),
     ("HAVE_STL_HASH",                  'UNDEF',                  'UNDEF'),
@@ -2452,7 +2445,7 @@ def WriteConfigSettings():
         # Android does have RTTI, but we disable it anyway.
         # Android does have RTTI, but we disable it anyway.
         dtool_config["HAVE_RTTI"] = 'UNDEF'
         dtool_config["HAVE_RTTI"] = 'UNDEF'
         dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
         dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
-        dtool_config["HAVE_LOCKF"] = 'UNDEF'
+        dtool_config["PHAVE_LOCKF"] = 'UNDEF'
         dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
         dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
 
 
     if (GetOptimize() <= 2 and GetTarget() == "windows"):
     if (GetOptimize() <= 2 and GetTarget() == "windows"):
@@ -2613,18 +2606,21 @@ PANDAVERSION_H_RUNTIME="""
 
 
 CHECKPANDAVERSION_CXX="""
 CHECKPANDAVERSION_CXX="""
 # include "dtoolbase.h"
 # include "dtoolbase.h"
-EXPCL_DTOOL_DTOOLUTIL int panda_version_$VERSION1_$VERSION2 = 0;
+EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
 """
 """
 
 
 CHECKPANDAVERSION_H="""
 CHECKPANDAVERSION_H="""
+# ifndef CHECKPANDAVERSION_H
+# define CHECKPANDAVERSION_H
 # include "dtoolbase.h"
 # include "dtoolbase.h"
-extern EXPCL_DTOOL_DTOOLUTIL int panda_version_$VERSION1_$VERSION2;
-# ifndef WIN32
-/* For Windows, exporting the symbol from the DLL is sufficient; the
-      DLL will not load unless all expected public symbols are defined.
-      Other systems may not mind if the symbol is absent unless we
-      explictly write code that references it. */
-static int check_panda_version = panda_version_$VERSION1_$VERSION2;
+extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
+// Hack to forcibly depend on the check
+template<typename T>
+class CheckPandaVersion {
+public:
+  int check_version() { return panda_version_$VERSION1_$VERSION2; }
+};
+template class CheckPandaVersion<void>;
 # endif
 # endif
 """
 """
 
 

+ 0 - 6
panda/metalibs/panda/panda.cxx

@@ -14,12 +14,6 @@
 #include "config_pstatclient.h"
 #include "config_pstatclient.h"
 #endif
 #endif
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpanda.so.dll will fail if they inadvertently link with the wrong
-// version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 #if !defined(CPPPARSER) && !defined(BUILDING_LIBPANDA)
 #if !defined(CPPPARSER) && !defined(BUILDING_LIBPANDA)
   #error Buildsystem error: BUILDING_LIBPANDA not defined
   #error Buildsystem error: BUILDING_LIBPANDA not defined
 #endif
 #endif

+ 0 - 6
panda/metalibs/pandabullet/pandabullet.cxx

@@ -7,12 +7,6 @@
 #include "pandabullet.h"
 #include "pandabullet.h"
 #include "config_bullet.h"
 #include "config_bullet.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandabullet.so.dll will fail if they inadvertently link with the
-// wrong version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandadx9/pandadx9.cxx

@@ -9,12 +9,6 @@
 #include "config_dxgsg9.h"
 #include "config_dxgsg9.h"
 #include "wdxGraphicsPipe9.h"
 #include "wdxGraphicsPipe9.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandadx9.dll will fail if they inadvertently link with the wrong
-// version of libdtool.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandaegg/pandaegg.cxx

@@ -9,12 +9,6 @@
 #include "config_egg.h"
 #include "config_egg.h"
 #include "config_egg2pg.h"
 #include "config_egg2pg.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandaegg.so.dll will fail if they inadvertently link with the wrong
-// version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandaegg/pandaeggnopg.cxx

@@ -8,12 +8,6 @@
 
 
 #include "config_egg.h"
 #include "config_egg.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandaegg.so.dll will fail if they inadvertently link with the wrong
-// version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandaexpress/pandaexpress.cxx

@@ -3,9 +3,3 @@
  * @author drose
  * @author drose
  * @date 2000-05-15
  * @date 2000-05-15
  */
  */
-
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandaexpress.so.dll will fail if they inadvertently link with the
-// wrong version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"

+ 0 - 6
panda/metalibs/pandafx/pandafx.cxx

@@ -8,12 +8,6 @@
 
 
 #include "config_distort.h"
 #include "config_distort.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandafx.so.dll will fail if they inadvertently link with the wrong
-// version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandagl/pandagl.cxx

@@ -30,12 +30,6 @@
 #error One of HAVE_WGL, HAVE_COCOA, HAVE_CARBON or HAVE_GLX must be defined when compiling pandagl!
 #error One of HAVE_WGL, HAVE_COCOA, HAVE_CARBON or HAVE_GLX must be defined when compiling pandagl!
 #endif
 #endif
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandagl.so.dll will fail if they inadvertently link with the wrong
-// version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandagles/pandagles.cxx

@@ -17,12 +17,6 @@
 #include "eglGraphicsPipe.h"
 #include "eglGraphicsPipe.h"
 #endif
 #endif
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandagles.so.dll will fail if they inadvertently link with the
-// wrong version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandagles2/pandagles2.cxx

@@ -12,12 +12,6 @@
 #include "config_egldisplay.h"
 #include "config_egldisplay.h"
 #include "eglGraphicsPipe.h"
 #include "eglGraphicsPipe.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandagles2.so.dll will fail if they inadvertently link with the
-// wrong version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandaode/pandaode.cxx

@@ -7,12 +7,6 @@
 #include "pandaode.h"
 #include "pandaode.h"
 #include "config_ode.h"
 #include "config_ode.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandaode.so.dll will fail if they inadvertently link with the wrong
-// version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandaphysics/pandaphysics.cxx

@@ -8,12 +8,6 @@
 #include "config_physics.h"
 #include "config_physics.h"
 #include "config_particlesystem.h"
 #include "config_particlesystem.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandaphysics.so.dll will fail if they inadvertently link with the
-// wrong version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/metalibs/pandaphysx/pandaphysx.cxx

@@ -7,12 +7,6 @@
 #include "pandaphysx.h"
 #include "pandaphysx.h"
 #include "config_physx.h"
 #include "config_physx.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to
-// load libpandaphysx.so.dll will fail if they inadvertently link with the
-// wrong version of libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 0 - 6
panda/src/android/pview.cxx

@@ -21,12 +21,6 @@
 #include "bamCache.h"
 #include "bamCache.h"
 #include "virtualFileSystem.h"
 #include "virtualFileSystem.h"
 
 
-// By including checkPandaVersion.h, we guarantee that runtime attempts to run
-// pview will fail if it inadvertently links with the wrong version of
-// libdtool.so.dll.
-
-#include "checkPandaVersion.h"
-
 int main(int argc, char **argv) {
 int main(int argc, char **argv) {
   PandaFramework framework;
   PandaFramework framework;
   framework.open_framework(argc, argv);
   framework.open_framework(argc, argv);

+ 1 - 1
panda/src/bullet/bulletSoftBodyNode.cxx

@@ -134,7 +134,7 @@ BulletSoftBodyNodeElement BulletSoftBodyNode::
 get_node(int idx) const {
 get_node(int idx) const {
   LightMutexHolder holder(BulletWorld::get_global_lock());
   LightMutexHolder holder(BulletWorld::get_global_lock());
 
 
-  nassertr(idx >=0 && idx < get_num_nodes(), BulletSoftBodyNodeElement::empty());
+  nassertr(idx >= 0 && idx < _soft->m_nodes.size(), BulletSoftBodyNodeElement::empty());
   return BulletSoftBodyNodeElement(_soft->m_nodes[idx]);
   return BulletSoftBodyNodeElement(_soft->m_nodes[idx]);
 }
 }
 
 

+ 1 - 1
panda/src/bullet/bulletTriangleMesh.h

@@ -32,7 +32,7 @@
 class EXPCL_PANDABULLET BulletTriangleMesh : public TypedWritableReferenceCount {
 class EXPCL_PANDABULLET BulletTriangleMesh : public TypedWritableReferenceCount {
 PUBLISHED:
 PUBLISHED:
   BulletTriangleMesh();
   BulletTriangleMesh();
-  ~BulletTriangleMesh() DEFAULT_DTOR;
+  ~BulletTriangleMesh() = default;
 
 
   void add_triangle(const LPoint3 &p0,
   void add_triangle(const LPoint3 &p0,
                     const LPoint3 &p1,
                     const LPoint3 &p1,

+ 1 - 1
panda/src/chan/partBundle.cxx

@@ -153,7 +153,7 @@ apply_transform(const TransformState *transform) {
     if ((*ati).first.is_valid_pointer() &&
     if ((*ati).first.is_valid_pointer() &&
         (*ati).second.is_valid_pointer()) {
         (*ati).second.is_valid_pointer()) {
       // Here's our cached result.
       // Here's our cached result.
-      return (*ati).second.p();
+      return (*ati).second.lock();
     }
     }
   }
   }
 
 

+ 6 - 6
panda/src/char/characterJoint.cxx

@@ -214,7 +214,7 @@ bool CharacterJoint::
 remove_net_transform(PandaNode *node) {
 remove_net_transform(PandaNode *node) {
   CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
   CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
   if (effect != (RenderEffect *)NULL &&
   if (effect != (RenderEffect *)NULL &&
-      DCAST(CharacterJointEffect, effect)->get_character() == _character) {
+      DCAST(CharacterJointEffect, effect)->matches_character(_character)) {
     node->clear_effect(CharacterJointEffect::get_class_type());
     node->clear_effect(CharacterJointEffect::get_class_type());
   }
   }
 
 
@@ -244,7 +244,7 @@ clear_net_transforms() {
 
 
     CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
     CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
     if (effect != (RenderEffect *)NULL &&
     if (effect != (RenderEffect *)NULL &&
-        DCAST(CharacterJointEffect, effect)->get_character() == _character) {
+        DCAST(CharacterJointEffect, effect)->matches_character(_character)) {
       node->clear_effect(CharacterJointEffect::get_class_type());
       node->clear_effect(CharacterJointEffect::get_class_type());
     }
     }
   }
   }
@@ -306,7 +306,7 @@ bool CharacterJoint::
 remove_local_transform(PandaNode *node) {
 remove_local_transform(PandaNode *node) {
   CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
   CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
   if (effect != (RenderEffect *)NULL &&
   if (effect != (RenderEffect *)NULL &&
-      DCAST(CharacterJointEffect, effect)->get_character() == _character) {
+      DCAST(CharacterJointEffect, effect)->matches_character(_character)) {
     node->clear_effect(CharacterJointEffect::get_class_type());
     node->clear_effect(CharacterJointEffect::get_class_type());
   }
   }
 
 
@@ -336,7 +336,7 @@ clear_local_transforms() {
 
 
     CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
     CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
     if (effect != (RenderEffect *)NULL &&
     if (effect != (RenderEffect *)NULL &&
-        DCAST(CharacterJointEffect, effect)->get_character() == _character) {
+        DCAST(CharacterJointEffect, effect)->matches_character(_character)) {
       node->clear_effect(CharacterJointEffect::get_class_type());
       node->clear_effect(CharacterJointEffect::get_class_type());
     }
     }
   }
   }
@@ -427,7 +427,7 @@ set_character(Character *character) {
 
 
         CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
         CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
         if (effect != (RenderEffect *)NULL &&
         if (effect != (RenderEffect *)NULL &&
-            DCAST(CharacterJointEffect, effect)->get_character() == _character) {
+            DCAST(CharacterJointEffect, effect)->matches_character(_character)) {
           node->clear_effect(CharacterJointEffect::get_class_type());
           node->clear_effect(CharacterJointEffect::get_class_type());
         }
         }
       }
       }
@@ -438,7 +438,7 @@ set_character(Character *character) {
 
 
         CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
         CPT(RenderEffect) effect = node->get_effect(CharacterJointEffect::get_class_type());
         if (effect != (RenderEffect *)NULL &&
         if (effect != (RenderEffect *)NULL &&
-            DCAST(CharacterJointEffect, effect)->get_character() == _character) {
+            DCAST(CharacterJointEffect, effect)->matches_character(_character)) {
           node->clear_effect(CharacterJointEffect::get_class_type());
           node->clear_effect(CharacterJointEffect::get_class_type());
         }
         }
       }
       }

+ 12 - 6
panda/src/char/characterJointEffect.I

@@ -23,11 +23,17 @@ CharacterJointEffect() {
  * Returns the Character that will get update() called on it when this node's
  * Returns the Character that will get update() called on it when this node's
  * relative transform is queried, or NULL if there is no such character.
  * relative transform is queried, or NULL if there is no such character.
  */
  */
-INLINE Character *CharacterJointEffect::
+INLINE PT(Character) CharacterJointEffect::
 get_character() const {
 get_character() const {
-  if (_character.is_valid_pointer()) {
-    return _character;
-  } else {
-    return NULL;
-  }
+  return _character.lock();
+}
+
+/**
+ * Returns true if this CharacterJointEffect contains the given Character.
+ * This exists because it is faster to check than get_character() and can even
+ * be called while the Character is destructing.
+ */
+INLINE bool CharacterJointEffect::
+matches_character(Character *character) const {
+  return _character == character;
 }
 }

+ 9 - 11
panda/src/char/characterJointEffect.cxx

@@ -89,8 +89,9 @@ safe_to_combine() const {
 void CharacterJointEffect::
 void CharacterJointEffect::
 output(ostream &out) const {
 output(ostream &out) const {
   out << get_type();
   out << get_type();
-  if (_character.is_valid_pointer()) {
-    out << "(" << _character->get_name() << ")";
+  PT(Character) character = get_character();
+  if (character != nullptr) {
+    out << "(" << character->get_name() << ")";
   } else {
   } else {
     out << "(**invalid**)";
     out << "(**invalid**)";
   }
   }
@@ -122,8 +123,8 @@ void CharacterJointEffect::
 cull_callback(CullTraverser *trav, CullTraverserData &data,
 cull_callback(CullTraverser *trav, CullTraverserData &data,
               CPT(TransformState) &node_transform,
               CPT(TransformState) &node_transform,
               CPT(RenderState) &) const {
               CPT(RenderState) &) const {
-  if (_character.is_valid_pointer()) {
-    _character->update();
+  if (auto character = _character.lock()) {
+    character->update();
   }
   }
   node_transform = data.node()->get_transform();
   node_transform = data.node()->get_transform();
 }
 }
@@ -150,8 +151,8 @@ void CharacterJointEffect::
 adjust_transform(CPT(TransformState) &net_transform,
 adjust_transform(CPT(TransformState) &net_transform,
                  CPT(TransformState) &node_transform,
                  CPT(TransformState) &node_transform,
                  const PandaNode *node) const {
                  const PandaNode *node) const {
-  if (_character.is_valid_pointer()) {
-    _character->update();
+  if (auto character = _character.lock()) {
+    character->update();
   }
   }
   node_transform = node->get_transform();
   node_transform = node->get_transform();
 }
 }
@@ -202,11 +203,8 @@ void CharacterJointEffect::
 write_datagram(BamWriter *manager, Datagram &dg) {
 write_datagram(BamWriter *manager, Datagram &dg) {
   RenderEffect::write_datagram(manager, dg);
   RenderEffect::write_datagram(manager, dg);
 
 
-  if (_character.is_valid_pointer()) {
-    manager->write_pointer(dg, _character);
-  } else {
-    manager->write_pointer(dg, NULL);
-  }
+  PT(Character) character = get_character();
+  manager->write_pointer(dg, character);
 }
 }
 
 
 /**
 /**

+ 3 - 1
panda/src/char/characterJointEffect.h

@@ -38,9 +38,11 @@ private:
 PUBLISHED:
 PUBLISHED:
   static CPT(RenderEffect) make(Character *character);
   static CPT(RenderEffect) make(Character *character);
 
 
-  INLINE Character *get_character() const;
+  INLINE PT(Character) get_character() const;
 
 
 public:
 public:
+  INLINE bool matches_character(Character *character) const;
+
   virtual bool safe_to_transform() const;
   virtual bool safe_to_transform() const;
   virtual bool safe_to_combine() const;
   virtual bool safe_to_combine() const;
   virtual void output(ostream &out) const;
   virtual void output(ostream &out) const;

+ 0 - 21
panda/src/display/displayRegion.I

@@ -479,13 +479,8 @@ INLINE void DisplayRegion::
 set_cull_result(PT(CullResult) cull_result, PT(SceneSetup) scene_setup,
 set_cull_result(PT(CullResult) cull_result, PT(SceneSetup) scene_setup,
                 Thread *current_thread) {
                 Thread *current_thread) {
   CDCullWriter cdata(_cycler_cull, true, current_thread);
   CDCullWriter cdata(_cycler_cull, true, current_thread);
-#ifdef USE_MOVE_SEMANTICS
   cdata->_cull_result = move(cull_result);
   cdata->_cull_result = move(cull_result);
   cdata->_scene_setup = move(scene_setup);
   cdata->_scene_setup = move(scene_setup);
-#else
-  swap(cdata->_cull_result, cull_result);
-  swap(cdata->_scene_setup, scene_setup);
-#endif
 }
 }
 
 
 /**
 /**
@@ -572,22 +567,6 @@ DisplayRegionPipelineReader(DisplayRegion *object, Thread *current_thread) :
 #endif // _DEBUG
 #endif // _DEBUG
 }
 }
 
 
-/**
- * Don't attempt to copy these objects.
- */
-INLINE DisplayRegionPipelineReader::
-DisplayRegionPipelineReader(const DisplayRegionPipelineReader &) {
-  nassertv(false);
-}
-
-/**
- * Don't attempt to copy these objects.
- */
-INLINE void DisplayRegionPipelineReader::
-operator = (const DisplayRegionPipelineReader &) {
-  nassertv(false);
-}
-
 /**
 /**
  *
  *
  */
  */

+ 0 - 19
panda/src/display/displayRegion.cxx

@@ -46,25 +46,6 @@ DisplayRegion(GraphicsOutput *window, const LVecBase4 &dimensions) :
   _window->add_display_region(this);
   _window->add_display_region(this);
 }
 }
 
 
-/**
- *
- */
-DisplayRegion::
-DisplayRegion(const DisplayRegion &copy) :
-  _window(NULL),
-  _cull_region_pcollector("Cull:Invalid"),
-  _draw_region_pcollector("Draw:Invalid")
-{
-}
-
-/**
- *
- */
-void DisplayRegion::
-operator = (const DisplayRegion&) {
-  nassertv(false);
-}
-
 /**
 /**
  *
  *
  */
  */

+ 4 - 7
panda/src/display/displayRegion.h

@@ -57,10 +57,8 @@ class CullTraverser;
 class EXPCL_PANDA_DISPLAY DisplayRegion : public TypedReferenceCount, public DrawableRegion {
 class EXPCL_PANDA_DISPLAY DisplayRegion : public TypedReferenceCount, public DrawableRegion {
 protected:
 protected:
   DisplayRegion(GraphicsOutput *window, const LVecBase4 &dimensions);
   DisplayRegion(GraphicsOutput *window, const LVecBase4 &dimensions);
-
-private:
-  DisplayRegion(const DisplayRegion &copy);
-  void operator = (const DisplayRegion &copy);
+  DisplayRegion(const DisplayRegion &copy) = delete;
+  void operator = (const DisplayRegion &copy) = delete;
 
 
 public:
 public:
   virtual ~DisplayRegion();
   virtual ~DisplayRegion();
@@ -310,9 +308,8 @@ private:
 class EXPCL_PANDA_DISPLAY DisplayRegionPipelineReader {
 class EXPCL_PANDA_DISPLAY DisplayRegionPipelineReader {
 public:
 public:
   INLINE DisplayRegionPipelineReader(DisplayRegion *object, Thread *current_thread);
   INLINE DisplayRegionPipelineReader(DisplayRegion *object, Thread *current_thread);
-private:
-  INLINE DisplayRegionPipelineReader(const DisplayRegionPipelineReader &copy);
-  INLINE void operator = (const DisplayRegionPipelineReader &copy);
+  DisplayRegionPipelineReader(const DisplayRegionPipelineReader &copy) = delete;
+  void operator = (const DisplayRegionPipelineReader &copy) = delete;
 
 
 public:
 public:
   INLINE ~DisplayRegionPipelineReader();
   INLINE ~DisplayRegionPipelineReader();

+ 0 - 16
panda/src/display/graphicsDevice.cxx

@@ -34,22 +34,6 @@ GraphicsDevice(GraphicsPipe *pipe) {
   }
   }
 }
 }
 
 
-/**
- *
- */
-GraphicsDevice::
-GraphicsDevice(const GraphicsDevice &) {
-  nassertv(false);
-}
-
-/**
- *
- */
-void GraphicsDevice::
-operator = (const GraphicsDevice &) {
-  nassertv(false);
-}
-
 /**
 /**
  *
  *
  */
  */

+ 2 - 4
panda/src/display/graphicsDevice.h

@@ -30,10 +30,8 @@ class GraphicsPipe;
 class EXPCL_PANDA_DISPLAY GraphicsDevice : public TypedReferenceCount {
 class EXPCL_PANDA_DISPLAY GraphicsDevice : public TypedReferenceCount {
 public:
 public:
   GraphicsDevice(GraphicsPipe *pipe);
   GraphicsDevice(GraphicsPipe *pipe);
-
-private:
-  GraphicsDevice(const GraphicsDevice &copy);
-  void operator = (const GraphicsDevice &copy);
+  GraphicsDevice(const GraphicsDevice &copy) = delete;
+  GraphicsDevice &operator = (const GraphicsDevice &copy) = delete;
 
 
 PUBLISHED:
 PUBLISHED:
   virtual ~GraphicsDevice();
   virtual ~GraphicsDevice();

+ 1 - 1
panda/src/display/graphicsEngine.cxx

@@ -1538,7 +1538,7 @@ cull_to_bins(GraphicsEngine::Windows wlist, Thread *current_thread) {
           }
           }
 
 
           // Save the results for next frame.
           // Save the results for next frame.
-          dr->set_cull_result(MOVE(cull_result), MOVE(scene_setup), current_thread);
+          dr->set_cull_result(move(cull_result), MOVE(scene_setup), current_thread);
         }
         }
       }
       }
     }
     }

+ 0 - 19
panda/src/display/graphicsOutput.cxx

@@ -159,25 +159,6 @@ GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe,
   set_clear_color(background_color.get_value());
   set_clear_color(background_color.get_value());
 }
 }
 
 
-/**
- *
- */
-GraphicsOutput::
-GraphicsOutput(const GraphicsOutput &) :
-  _cull_window_pcollector(_cull_pcollector, "Invalid"),
-  _draw_window_pcollector(_draw_pcollector, "Invalid")
-{
-  nassertv(false);
-}
-
-/**
- *
- */
-void GraphicsOutput::
-operator = (const GraphicsOutput &) {
-  nassertv(false);
-}
-
 /**
 /**
  *
  *
  */
  */

+ 2 - 4
panda/src/display/graphicsOutput.h

@@ -70,10 +70,8 @@ protected:
                  GraphicsStateGuardian *gsg,
                  GraphicsStateGuardian *gsg,
                  GraphicsOutput *host,
                  GraphicsOutput *host,
                  bool default_stereo_flags);
                  bool default_stereo_flags);
-
-private:
-  GraphicsOutput(const GraphicsOutput &copy);
-  void operator = (const GraphicsOutput &copy);
+  GraphicsOutput(const GraphicsOutput &copy) = delete;
+  GraphicsOutput &operator = (const GraphicsOutput &copy) = delete;
 
 
 PUBLISHED:
 PUBLISHED:
   enum RenderTextureMode {
   enum RenderTextureMode {

+ 2 - 3
panda/src/display/graphicsPipe.h

@@ -52,9 +52,8 @@ class DisplayInformation;
 class EXPCL_PANDA_DISPLAY GraphicsPipe : public TypedReferenceCount {
 class EXPCL_PANDA_DISPLAY GraphicsPipe : public TypedReferenceCount {
 protected:
 protected:
   GraphicsPipe();
   GraphicsPipe();
-private:
-  GraphicsPipe(const GraphicsPipe &copy) DELETED;
-  GraphicsPipe &operator = (const GraphicsPipe &copy) DELETED_ASSIGN;
+  GraphicsPipe(const GraphicsPipe &copy) = delete;
+  GraphicsPipe &operator = (const GraphicsPipe &copy) = delete;
 
 
 PUBLISHED:
 PUBLISHED:
   virtual ~GraphicsPipe();
   virtual ~GraphicsPipe();

+ 1 - 1
panda/src/display/graphicsStateGuardian.h

@@ -286,7 +286,7 @@ PUBLISHED:
   MAKE_PROPERTY(driver_shader_version_minor, get_driver_shader_version_minor);
   MAKE_PROPERTY(driver_shader_version_minor, get_driver_shader_version_minor);
 
 
   bool set_scene(SceneSetup *scene_setup);
   bool set_scene(SceneSetup *scene_setup);
-  virtual SceneSetup *get_scene() const FINAL;
+  virtual SceneSetup *get_scene() const final;
   MAKE_PROPERTY(scene, get_scene, set_scene);
   MAKE_PROPERTY(scene, get_scene, set_scene);
 
 
 public:
 public:

+ 8 - 8
panda/src/downloader/multiplexStreamBuf.cxx

@@ -122,9 +122,9 @@ add_output(MultiplexStreamBuf::BufferType buffer_type,
   o._owns_obj = owns_obj;
   o._owns_obj = owns_obj;
 
 
   // Ensure that we have the mutex while we fiddle with the list of outputs.
   // Ensure that we have the mutex while we fiddle with the list of outputs.
-  _lock.acquire();
+  _lock.lock();
   _outputs.push_back(o);
   _outputs.push_back(o);
-  _lock.release();
+  _lock.unlock();
 }
 }
 
 
 
 
@@ -133,9 +133,9 @@ add_output(MultiplexStreamBuf::BufferType buffer_type,
  */
  */
 void MultiplexStreamBuf::
 void MultiplexStreamBuf::
 flush() {
 flush() {
-  _lock.acquire();
+  _lock.lock();
   write_chars("", 0, true);
   write_chars("", 0, true);
-  _lock.release();
+  _lock.unlock();
 }
 }
 
 
 /**
 /**
@@ -144,7 +144,7 @@ flush() {
  */
  */
 int MultiplexStreamBuf::
 int MultiplexStreamBuf::
 overflow(int ch) {
 overflow(int ch) {
-  _lock.acquire();
+  _lock.lock();
 
 
   streamsize n = pptr() - pbase();
   streamsize n = pptr() - pbase();
 
 
@@ -159,7 +159,7 @@ overflow(int ch) {
     write_chars(&c, 1, false);
     write_chars(&c, 1, false);
   }
   }
 
 
-  _lock.release();
+  _lock.unlock();
   return 0;
   return 0;
 }
 }
 
 
@@ -169,7 +169,7 @@ overflow(int ch) {
  */
  */
 int MultiplexStreamBuf::
 int MultiplexStreamBuf::
 sync() {
 sync() {
-  _lock.acquire();
+  _lock.lock();
 
 
   streamsize n = pptr() - pbase();
   streamsize n = pptr() - pbase();
 
 
@@ -181,7 +181,7 @@ sync() {
   write_chars(pbase(), n, false);
   write_chars(pbase(), n, false);
   pbump(-n);
   pbump(-n);
 
 
-  _lock.release();
+  _lock.unlock();
   return 0;  // Return 0 for success, EOF to indicate write full.
   return 0;  // Return 0 for success, EOF to indicate write full.
 }
 }
 
 

+ 4 - 4
panda/src/downloader/virtualFileMountHTTP.cxx

@@ -238,7 +238,7 @@ output(ostream &out) const {
 PT(HTTPChannel) VirtualFileMountHTTP::
 PT(HTTPChannel) VirtualFileMountHTTP::
 get_channel() {
 get_channel() {
   PT(HTTPChannel) channel;
   PT(HTTPChannel) channel;
-  _channels_lock.acquire();
+  _channels_lock.lock();
 
 
   if (!_channels.empty()) {
   if (!_channels.empty()) {
     // If we have some channels sitting around, grab one.  Grab the one on the
     // If we have some channels sitting around, grab one.  Grab the one on the
@@ -251,7 +251,7 @@ get_channel() {
     channel = _http->make_channel(true);
     channel = _http->make_channel(true);
   }
   }
 
 
-  _channels_lock.release();
+  _channels_lock.unlock();
   return channel;
   return channel;
 }
 }
 
 
@@ -262,9 +262,9 @@ get_channel() {
  */
  */
 void VirtualFileMountHTTP::
 void VirtualFileMountHTTP::
 recycle_channel(HTTPChannel *channel) {
 recycle_channel(HTTPChannel *channel) {
-  _channels_lock.acquire();
+  _channels_lock.lock();
   _channels.push_back(channel);
   _channels.push_back(channel);
-  _channels_lock.release();
+  _channels_lock.unlock();
 }
 }
 
 
 #endif  // HAVE_OPENSSL
 #endif  // HAVE_OPENSSL

+ 2 - 2
panda/src/dxgsg9/dxGeomMunger9.I

@@ -31,6 +31,6 @@ DXGeomMunger9(GraphicsStateGuardian *gsg, const RenderState *state) :
   }
   }
   // Set a callback to unregister ourselves when either the Texture or the
   // Set a callback to unregister ourselves when either the Texture or the
   // TexGen object gets deleted.
   // TexGen object gets deleted.
-  _texture.set_callback(this);
-  _tex_gen.set_callback(this);
+  _texture.add_callback(this);
+  _tex_gen.add_callback(this);
 }
 }

+ 3 - 0
panda/src/dxgsg9/dxGeomMunger9.cxx

@@ -28,6 +28,9 @@ DXGeomMunger9::
     unref_delete(_filtered_texture);
     unref_delete(_filtered_texture);
     _reffed_filtered_texture = false;
     _reffed_filtered_texture = false;
   }
   }
+
+  _texture.remove_callback(this);
+  _tex_gen.remove_callback(this);
 }
 }
 
 
 /**
 /**

+ 2 - 2
panda/src/event/asyncFuture.cxx

@@ -273,9 +273,9 @@ wake_task(AsyncTask *task) {
     }
     }
 
 
     {
     {
-      manager->_lock.release();
+      manager->_lock.unlock();
       task->upon_birth(manager);
       task->upon_birth(manager);
-      manager->_lock.acquire();
+      manager->_lock.lock();
       nassertv(task->_manager == nullptr &&
       nassertv(task->_manager == nullptr &&
                task->_state == AsyncTask::S_inactive);
                task->_state == AsyncTask::S_inactive);
 
 

+ 1 - 1
panda/src/event/asyncFuture.h

@@ -160,7 +160,7 @@ INLINE ostream &operator << (ostream &out, const AsyncFuture &fut) {
 /**
 /**
  * Specific future that collects the results of several futures.
  * Specific future that collects the results of several futures.
  */
  */
-class EXPCL_PANDA_EVENT AsyncGatheringFuture FINAL : public AsyncFuture {
+class EXPCL_PANDA_EVENT AsyncGatheringFuture final : public AsyncFuture {
 private:
 private:
   AsyncGatheringFuture(AsyncFuture::Futures futures);
   AsyncGatheringFuture(AsyncFuture::Futures futures);
 
 

+ 2 - 2
panda/src/event/asyncTask.cxx

@@ -415,7 +415,7 @@ unlock_and_do_task() {
 #endif  // __GNUC__
 #endif  // __GNUC__
 
 
   // It's important to release the lock while the task is being serviced.
   // It's important to release the lock while the task is being serviced.
-  _manager->_lock.release();
+  _manager->_lock.unlock();
 
 
   double start = clock->get_real_time();
   double start = clock->get_real_time();
   _task_pcollector.start();
   _task_pcollector.start();
@@ -424,7 +424,7 @@ unlock_and_do_task() {
   double end = clock->get_real_time();
   double end = clock->get_real_time();
 
 
   // Now reacquire the lock (so we can return with the lock held).
   // Now reacquire the lock (so we can return with the lock held).
-  _manager->_lock.acquire();
+  _manager->_lock.lock();
 
 
   _dt = end - start;
   _dt = end - start;
   _max_dt = max(_dt, _max_dt);
   _max_dt = max(_dt, _max_dt);

Some files were not shown because too many files changed in this diff