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.
This commit is contained in:
Simon Detheridge 2015-01-14 13:15:23 +00:00
parent fbdd160061
commit 2999cd159f
4 changed files with 22 additions and 13 deletions

View File

@ -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. //First check if a controller has already been created, and if so, save its embers and gracefully shut it down.
if (m_Controller.get()) if (m_Controller.get())
{ {
m_Controller->CopyEmberFile(efd);//Convert float to double or save double verbatim; #ifdef DO_DOUBLE
m_Controller->CopyEmberFile(efd, [&](Ember<double>& ember) { });//Convert float to double or save double verbatim;
#else
m_Controller->CopyEmberFile(efd, [&](Ember<float>& ember) { });//Convert float to double or save double verbatim;
#endif
m_Controller->Shutdown(); m_Controller->Shutdown();
} }

View File

@ -105,10 +105,10 @@ public:
//Virtual functions overridden from FractoriumEmberControllerBase. //Virtual functions overridden from FractoriumEmberControllerBase.
virtual void SetEmberFile(const EmberFile<float>& emberFile) override; virtual void SetEmberFile(const EmberFile<float>& emberFile) override;
virtual void CopyEmberFile(EmberFile<float>& emberFile, std::function<void(Ember<float>& ember)> perEmberOperation = [&](Ember<float>& ember) { }) override; virtual void CopyEmberFile(EmberFile<float>& emberFile, std::function<void(Ember<float>& ember)> perEmberOperation/* = [&](Ember<float>& ember) { }*/) override;
#ifdef DO_DOUBLE #ifdef DO_DOUBLE
virtual void SetEmberFile(const EmberFile<double>& emberFile) override; virtual void SetEmberFile(const EmberFile<double>& emberFile) override;
virtual void CopyEmberFile(EmberFile<double>& emberFile, std::function<void(Ember<double>& ember)> perEmberOperation = [&](Ember<double>& ember) { }) override; virtual void CopyEmberFile(EmberFile<double>& emberFile, std::function<void(Ember<double>& ember)> perEmberOperation/* = [&](Ember<double>& ember) { }*/) override;
#endif #endif
virtual void SetEmber(size_t index) override; virtual void SetEmber(size_t index) override;
virtual bool Render() override; virtual bool Render() override;

View File

@ -41,16 +41,16 @@ public:
//Embers. //Embers.
virtual void SetEmber(const Ember<float>& ember, bool verbatim = false) { } virtual void SetEmber(const Ember<float>& ember, bool verbatim = false) { }
virtual void CopyEmber(Ember<float>& ember, std::function<void(Ember<float>& ember)> perEmberOperation = [&](Ember<float>& ember) { }) { } virtual void CopyEmber(Ember<float>& ember, std::function<void(Ember<float>& ember)> perEmberOperation/* = [&](Ember<float>& ember) { }*/) { }
virtual void SetEmberFile(const EmberFile<float>& emberFile) { } virtual void SetEmberFile(const EmberFile<float>& emberFile) { }
virtual void CopyEmberFile(EmberFile<float>& emberFile, std::function<void(Ember<float>& ember)> perEmberOperation = [&](Ember<float>& ember) { }) { } virtual void CopyEmberFile(EmberFile<float>& emberFile, std::function<void(Ember<float>& ember)> perEmberOperation/* = [&](Ember<float>& ember) { }*/) { }
virtual void SetTempPalette(const Palette<float>& palette) { } virtual void SetTempPalette(const Palette<float>& palette) { }
virtual void CopyTempPalette(Palette<float>& palette) { } virtual void CopyTempPalette(Palette<float>& palette) { }
#ifdef DO_DOUBLE #ifdef DO_DOUBLE
virtual void SetEmber(const Ember<double>& ember, bool verbatim = false) { } virtual void SetEmber(const Ember<double>& ember, bool verbatim = false) { }
virtual void CopyEmber(Ember<double>& ember, std::function<void(Ember<double>& ember)> perEmberOperation = [&](Ember<double>& ember) { }) { } virtual void CopyEmber(Ember<double>& ember, std::function<void(Ember<double>& ember)> perEmberOperation/* = [&](Ember<double>& ember) { }*/) { }
virtual void SetEmberFile(const EmberFile<double>& emberFile) { } virtual void SetEmberFile(const EmberFile<double>& emberFile) { }
virtual void CopyEmberFile(EmberFile<double>& emberFile, std::function<void(Ember<double>& ember)> perEmberOperation = [&](Ember<double>& ember) { }) { } virtual void CopyEmberFile(EmberFile<double>& emberFile, std::function<void(Ember<double>& ember)> perEmberOperation/* = [&](Ember<double>& ember) { }*/) { }
virtual void SetTempPalette(const Palette<double>& palette) { } virtual void SetTempPalette(const Palette<double>& palette) { }
virtual void CopyTempPalette(Palette<double>& palette) { } virtual void CopyTempPalette(Palette<double>& palette) { }
#endif #endif
@ -254,16 +254,16 @@ public:
//Embers. //Embers.
virtual void SetEmber(const Ember<float>& ember, bool verbatim = false) override; virtual void SetEmber(const Ember<float>& ember, bool verbatim = false) override;
virtual void CopyEmber(Ember<float>& ember, std::function<void(Ember<float>& ember)> perEmberOperation = [&](Ember<float>& ember) { }) override; virtual void CopyEmber(Ember<float>& ember, std::function<void(Ember<float>& ember)> perEmberOperation/* = [&](Ember<float>& ember) { }*/) override;
virtual void SetEmberFile(const EmberFile<float>& emberFile) override; virtual void SetEmberFile(const EmberFile<float>& emberFile) override;
virtual void CopyEmberFile(EmberFile<float>& emberFile, std::function<void(Ember<float>& ember)> perEmberOperation = [&](Ember<float>& ember) { }) override; virtual void CopyEmberFile(EmberFile<float>& emberFile, std::function<void(Ember<float>& ember)> perEmberOperation/* = [&](Ember<float>& ember) { }*/) override;
virtual void SetTempPalette(const Palette<float>& palette) override; virtual void SetTempPalette(const Palette<float>& palette) override;
virtual void CopyTempPalette(Palette<float>& palette) override; virtual void CopyTempPalette(Palette<float>& palette) override;
#ifdef DO_DOUBLE #ifdef DO_DOUBLE
virtual void SetEmber(const Ember<double>& ember, bool verbatim = false) override; virtual void SetEmber(const Ember<double>& ember, bool verbatim = false) override;
virtual void CopyEmber(Ember<double>& ember, std::function<void(Ember<double>& ember)> perEmberOperation = [&](Ember<double>& ember) { }) override; virtual void CopyEmber(Ember<double>& ember, std::function<void(Ember<double>& ember)> perEmberOperation/* = [&](Ember<double>& ember) { }*/) override;
virtual void SetEmberFile(const EmberFile<double>& emberFile) override; virtual void SetEmberFile(const EmberFile<double>& emberFile) override;
virtual void CopyEmberFile(EmberFile<double>& emberFile, std::function<void(Ember<double>& ember)> perEmberOperation = [&](Ember<double>& ember) { }) override; virtual void CopyEmberFile(EmberFile<double>& emberFile, std::function<void(Ember<double>& ember)> perEmberOperation/* = [&](Ember<double>& ember) { }*/) override;
virtual void SetTempPalette(const Palette<double>& palette) override; virtual void SetTempPalette(const Palette<double>& palette) override;
virtual void CopyTempPalette(Palette<double>& palette) override; virtual void CopyTempPalette(Palette<double>& palette) override;
#endif #endif

View File

@ -642,8 +642,13 @@ bool Fractorium::CreateControllerFromOptions()
if (m_Controller.get()) if (m_Controller.get())
{ {
m_Controller->CopyTempPalette(tempPalette);//Convert float to double or save double verbatim; m_Controller->CopyTempPalette(tempPalette);//Convert float to double or save double verbatim;
m_Controller->CopyEmber(ed); #ifdef DO_DOUBLE
m_Controller->CopyEmberFile(efd); m_Controller->CopyEmber(ed, [&](Ember<double>& ember) { });
m_Controller->CopyEmberFile(efd, [&](Ember<double>& ember) { });
#else
m_Controller->CopyEmber(ed, [&](Ember<float>& ember) { });
m_Controller->CopyEmberFile(efd, [&](Ember<float>& ember) { });
#endif
m_Controller->Shutdown(); m_Controller->Shutdown();
} }