As GCC 4.1 is now moving into prerelease state I have had another look at the GCC 4.1 compile failures. I do not really understand them; if this is how it should be or if GCC 4.1 has regressed.
Anyhow, this patch makes LyX compile. Do any of you have an opinion if this is our bug or if it is a GCC regression?
Index: src/graphics/GraphicsCacheItem.C =================================================================== --- src/graphics/GraphicsCacheItem.C (revision 13257) +++ src/graphics/GraphicsCacheItem.C (working copy) @@ -295,7 +295,7 @@ cl_.disconnect(); cl_ = image_->finishedLoading.connect( - boost::bind(&Impl::imageLoaded, this, _1)); + boost::bind(&Impl::imageLoaded, boost::ref(*this), _1)); image_->load(file_to_load_); } @@ -440,7 +440,7 @@ // the graphics converter so that we can load the modified file // on completion of the conversion process. converter_.reset(new Converter(filename, to_file_base, from, to)); - converter_->connect(boost::bind(&Impl::imageConverted, this, _1)); + converter_->connect(boost::bind(&Impl::imageConverted, boost::ref(*this), _1)); converter_->startConversion(); } Index: src/graphics/GraphicsLoader.C =================================================================== --- src/graphics/GraphicsLoader.C (revision 13257) +++ src/graphics/GraphicsLoader.C (working copy) @@ -240,7 +240,7 @@ if (continue_monitoring && !cached_item_->monitoring()) cached_item_->startMonitoring(); - cached_item_->connect(boost::bind(&Impl::statusChanged, this)); + cached_item_->connect(boost::bind(&Impl::statusChanged, boost::ref(*this))); } Index: src/graphics/GraphicsLoader.h =================================================================== --- src/graphics/GraphicsLoader.h (revision 13257) +++ src/graphics/GraphicsLoader.h (working copy) @@ -89,7 +89,7 @@ * changes. */ typedef boost::signal<void()> sig_type; - typedef sig_type::slot_type slot_type; + typedef boost::function<void()> slot_type; /// boost::signals::connection connect(slot_type const &) const; Index: src/support/FileMonitor.h =================================================================== --- src/support/FileMonitor.h (revision 13257) +++ src/support/FileMonitor.h (working copy) @@ -53,7 +53,7 @@ /// Connect and you'll be informed when the file has changed. typedef boost::signal<void()> FileChangedSig; - typedef FileChangedSig::slot_type slot_type; + typedef boost::function<void()> slot_type; /// boost::signals::connection connect(slot_type const &) const;
-- Lgb