diff --git a/contrib/src/rplight/pointerSlotStorage.h b/contrib/src/rplight/pointerSlotStorage.h index 11b4ace2bd..2d908c5795 100644 --- a/contrib/src/rplight/pointerSlotStorage.h +++ b/contrib/src/rplight/pointerSlotStorage.h @@ -38,7 +38,14 @@ class PointerSlotStorage {}; #include "pandabase.h" + +// Apple has an outdated libstdc++, so pull the class from TR1. +#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20070719 +#include +using std::tr1::array; +#else #include +#endif /** * @brief Class to keep a list of pointers and nullpointers. @@ -58,7 +65,11 @@ public: * initialized to a nullptr. */ PointerSlotStorage() { +#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20070719 + _data.assign(nullptr); +#else _data.fill(nullptr); +#endif _max_index = 0; _num_entries = 0; } diff --git a/contrib/src/rplight/pssmCameraRig.cxx b/contrib/src/rplight/pssmCameraRig.cxx index 98da3840f3..b9560a80d2 100644 --- a/contrib/src/rplight/pssmCameraRig.cxx +++ b/contrib/src/rplight/pssmCameraRig.cxx @@ -84,7 +84,7 @@ void PSSMCameraRig::init_cam_nodes() { lens->set_near_far(1, 1000); // Construct a new camera - _cameras[i] = new Camera("pssm-cam-" + to_string(((long long)i)), lens); + _cameras[i] = new Camera("pssm-cam-" + format_string(i), lens); _cam_nodes.push_back(NodePath(_cameras[i])); _max_film_sizes[i].fill(0); } diff --git a/contrib/src/rplight/shadowManager.cxx b/contrib/src/rplight/shadowManager.cxx index 8b7b1b1f96..be216c0075 100644 --- a/contrib/src/rplight/shadowManager.cxx +++ b/contrib/src/rplight/shadowManager.cxx @@ -79,7 +79,7 @@ void ShadowManager::init() { for(size_t i = 0; i < _max_updates; ++i) { // Create the camera - PT(Camera) camera = new Camera("ShadowCam-" + to_string((long long)i)); + PT(Camera) camera = new Camera("ShadowCam-" + format_string(i)); camera->set_lens(new MatrixLens()); camera->set_active(false); camera->set_scene(_scene_parent);