From 2999cd159f73b900c43d4ff96e24a652e83bddc4 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Wed, 14 Jan 2015 13:15:23 +0000 Subject: [PATCH] Work around segfault in LLVM on osx by removing lambda default parameters It's an ugly hack, but it's the only workaround I could find. --- Source/Fractorium/FinalRenderDialog.cpp | 6 +++++- Source/Fractorium/FinalRenderEmberController.h | 4 ++-- Source/Fractorium/FractoriumEmberController.h | 16 ++++++++-------- Source/Fractorium/FractoriumRender.cpp | 9 +++++++-- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Source/Fractorium/FinalRenderDialog.cpp b/Source/Fractorium/FinalRenderDialog.cpp index a08a4c0..bb58405 100644 --- a/Source/Fractorium/FinalRenderDialog.cpp +++ b/Source/Fractorium/FinalRenderDialog.cpp @@ -667,7 +667,11 @@ bool FractoriumFinalRenderDialog::CreateControllerFromGUI(bool createRenderer) //First check if a controller has already been created, and if so, save its embers and gracefully shut it down. if (m_Controller.get()) { - m_Controller->CopyEmberFile(efd);//Convert float to double or save double verbatim; +#ifdef DO_DOUBLE + m_Controller->CopyEmberFile(efd, [&](Ember& ember) { });//Convert float to double or save double verbatim; +#else + m_Controller->CopyEmberFile(efd, [&](Ember& ember) { });//Convert float to double or save double verbatim; +#endif m_Controller->Shutdown(); } diff --git a/Source/Fractorium/FinalRenderEmberController.h b/Source/Fractorium/FinalRenderEmberController.h index 67e2ea6..b411c05 100644 --- a/Source/Fractorium/FinalRenderEmberController.h +++ b/Source/Fractorium/FinalRenderEmberController.h @@ -105,10 +105,10 @@ public: //Virtual functions overridden from FractoriumEmberControllerBase. virtual void SetEmberFile(const EmberFile& emberFile) override; - virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) override; + virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) override; #ifdef DO_DOUBLE virtual void SetEmberFile(const EmberFile& emberFile) override; - virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) override; + virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) override; #endif virtual void SetEmber(size_t index) override; virtual bool Render() override; diff --git a/Source/Fractorium/FractoriumEmberController.h b/Source/Fractorium/FractoriumEmberController.h index bcdd22c..f0c25bd 100644 --- a/Source/Fractorium/FractoriumEmberController.h +++ b/Source/Fractorium/FractoriumEmberController.h @@ -41,16 +41,16 @@ public: //Embers. virtual void SetEmber(const Ember& ember, bool verbatim = false) { } - virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) { } + virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) { } virtual void SetEmberFile(const EmberFile& emberFile) { } - virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) { } + virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) { } virtual void SetTempPalette(const Palette& palette) { } virtual void CopyTempPalette(Palette& palette) { } #ifdef DO_DOUBLE virtual void SetEmber(const Ember& ember, bool verbatim = false) { } - virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) { } + virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) { } virtual void SetEmberFile(const EmberFile& emberFile) { } - virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) { } + virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) { } virtual void SetTempPalette(const Palette& palette) { } virtual void CopyTempPalette(Palette& palette) { } #endif @@ -254,16 +254,16 @@ public: //Embers. virtual void SetEmber(const Ember& ember, bool verbatim = false) override; - virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) override; + virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) override; virtual void SetEmberFile(const EmberFile& emberFile) override; - virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) override; + virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) override; virtual void SetTempPalette(const Palette& palette) override; virtual void CopyTempPalette(Palette& palette) override; #ifdef DO_DOUBLE virtual void SetEmber(const Ember& ember, bool verbatim = false) override; - virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) override; + virtual void CopyEmber(Ember& ember, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) override; virtual void SetEmberFile(const EmberFile& emberFile) override; - virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation = [&](Ember& ember) { }) override; + virtual void CopyEmberFile(EmberFile& emberFile, std::function& ember)> perEmberOperation/* = [&](Ember& ember) { }*/) override; virtual void SetTempPalette(const Palette& palette) override; virtual void CopyTempPalette(Palette& palette) override; #endif diff --git a/Source/Fractorium/FractoriumRender.cpp b/Source/Fractorium/FractoriumRender.cpp index 5357d70..726d667 100644 --- a/Source/Fractorium/FractoriumRender.cpp +++ b/Source/Fractorium/FractoriumRender.cpp @@ -642,8 +642,13 @@ bool Fractorium::CreateControllerFromOptions() if (m_Controller.get()) { m_Controller->CopyTempPalette(tempPalette);//Convert float to double or save double verbatim; - m_Controller->CopyEmber(ed); - m_Controller->CopyEmberFile(efd); +#ifdef DO_DOUBLE + m_Controller->CopyEmber(ed, [&](Ember& ember) { }); + m_Controller->CopyEmberFile(efd, [&](Ember& ember) { }); +#else + m_Controller->CopyEmber(ed, [&](Ember& ember) { }); + m_Controller->CopyEmberFile(efd, [&](Ember& ember) { }); +#endif m_Controller->Shutdown(); }