rplight: compatibility with old macOS glibc

This commit is contained in:
rdb 2018-01-17 17:08:08 +01:00
parent 8f5d55c539
commit bfd5fa56fa
3 changed files with 13 additions and 2 deletions

View File

@ -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 <tr1/array>
using std::tr1::array;
#else
#include <array>
#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;
}

View File

@ -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);
}

View File

@ -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);