Am Donnerstag, 17. August 2006 21:41 schrieb Jean-Marc Lasgouttes: > >>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes: > > Georg> Am Donnerstag, 17. August 2006 20:00 schrieb José Matos: > >> I am running FC5 as well but as reported in this thread this seems > >> to > Georg> be an > >> issue with gcc 4.1 that is not exclusive of FC5. :-( > > Georg> Yes. Fortunately we know the cause and will fix it for 1.4.3: > Georg> The included boost 1.32 does not work well with gcc 4.1. This > Georg> is fixed in boost 1.33. > > What do we have to do to upgrade boost like that?
This. Well, the BOOST_VERSION stuff is only necessary if you also want to be able to use 1.34cvs. It is taken from Lars' new boost branch and slightly adapted, the rest is taken from trunk. Georg
Index: src/frontends/qt2/QtView.C =================================================================== --- src/frontends/qt2/QtView.C (Revision 14787) +++ src/frontends/qt2/QtView.C (Arbeitskopie) @@ -20,6 +20,10 @@ #include "support/filetools.h" +#include <boost/version.hpp> +#if BOOST_VERSION >= 103300 && BOOST_VERSION < 103400 +#include <boost/visit_each.hpp> +#endif #include <boost/bind.hpp> #include "QtView.h" Index: src/frontends/controllers/biblio.C =================================================================== --- src/frontends/controllers/biblio.C (Revision 14787) +++ src/frontends/controllers/biblio.C (Arbeitskopie) @@ -376,13 +376,13 @@ string const escape_special_chars(string // Note that '[' and '\' must be escaped. // This is a limitation of boost::regex, but all other chars in BREs // are assumed literal. - boost::RegEx reg("[].|*?+(){}^$\\[\\\\]"); + boost::regex reg("[].|*?+(){}^$\\[\\\\]"); // $& is a perl-like expression that expands to all of the current match // The '$' must be prefixed with the escape character '\' for // boost to treat it as a literal. // Thus, to prefix a matched expression with '\', we use: - return reg.Merge(expr, "\\\\$&"); + return boost::regex_replace(expr, reg, "\\\\$&"); } @@ -409,14 +409,14 @@ public: // Attempts to find a match for the current RE // somewhere in data. - return regex_.Search(data); + return boost::regex_search(data, regex_); } bool validRE() const { return regex_.error_code() == 0; } private: InfoMap const map_; - mutable boost::RegEx regex_; + mutable boost::regex regex_; }; } // namespace anon Index: src/support/path.h =================================================================== --- src/support/path.h (Revision 14787) +++ src/support/path.h (Arbeitskopie) @@ -54,9 +54,10 @@ private: // Path p("/tmp"); // right // we add this macro: /// -#ifndef PATH_C -#define Path(x) unnamed_Path; -#endif +// With boost 1.34 this is not usable anymore +//#ifndef PATH_C +//#define Path(x) unnamed_Path; +//#endif // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal } // namespace support Index: src/support/translator.h =================================================================== --- src/support/translator.h (Revision 14787) +++ src/support/translator.h (Arbeitskopie) @@ -13,6 +13,10 @@ #define TRANSLATOR_H #include <boost/assert.hpp> +#include <boost/version.hpp> +#if BOOST_VERSION >= 103300 && BOOST_VERSION < 103400 +#include <boost/visit_each.hpp> +#endif #include <boost/bind.hpp> #include <vector> Index: src/support/filetools.C =================================================================== --- src/support/filetools.C (Revision 14787) +++ src/support/filetools.C (Arbeitskopie) @@ -599,42 +599,16 @@ string const ExpandPath(string const & p // Also converts paths like /foo//bar ==> /foo/bar string const NormalizePath(string const & path) { - string TempBase; - string RTemp; - string Temp; + // Normalize paths like /foo//bar ==> /foo/bar + static boost::regex regex("/{2,}"); + string const tmppath = boost::regex_merge(path, regex, "/"); - if (os::is_absolute_path(path)) - RTemp = path; - else - // Make implicit current directory explicit - RTemp = "./" + path; + fs::path const npath = fs::path(tmppath, fs::no_check).normalize(); - // Normalise paths like /foo//bar ==> /foo/bar - boost::RegEx regex("/{2,}"); - RTemp = regex.Merge(RTemp, "/"); - - while (!RTemp.empty()) { - // Split by next / - RTemp = split(RTemp, Temp, '/'); - - if (Temp == ".") { - TempBase = "./"; - } else if (Temp == "..") { - // Remove one level of TempBase - string::difference_type i = TempBase.length() - 2; - while (i > 0 && TempBase[i] != '/') - --i; - if (i >= 0 && TempBase[i] == '/') - TempBase.erase(i + 1, string::npos); - else - TempBase = "../"; - } else { - TempBase += Temp + '/'; - } - } + if (!npath.is_complete()) + return "./" + npath.string() + '/'; - // returns absolute path - return TempBase; + return npath.string() + '/'; } Index: src/support/fs_extras.C =================================================================== --- src/support/fs_extras.C (Revision 14787) +++ src/support/fs_extras.C (Arbeitskopie) @@ -17,6 +17,7 @@ #include <boost/filesystem/exception.hpp> #include <boost/detail/workaround.hpp> #include <boost/throw_exception.hpp> +#include <boost/version.hpp> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> @@ -45,6 +46,22 @@ namespace fs = boost::filesystem; namespace boost { namespace filesystem { +#if BOOST_VERSION >= 103400 +#include <cerrno> +#define filesystem_error filesystem_path_error +namespace detail { + fs::errno_type system_error_code() + { +#ifdef BOOST_POSIX + return fs::lookup_errno(errno); +#endif +#ifdef BOOST_WINDOWS + return fs::detail::system_error_code(errno); +#endif + } +} +#endif + bool is_readable(path const & ph) { #ifdef BOOST_POSIX Index: src/support/debugstream.h =================================================================== --- src/support/debugstream.h (Revision 14787) +++ src/support/debugstream.h (Arbeitskopie) @@ -14,7 +14,13 @@ #include <iostream> -#include <boost/test/detail/nullstream.hpp> +#include <boost/version.hpp> + +#if BOOST_VERSION < 103300 +# include <boost/test/detail/nullstream.hpp> +#else +# include <boost/test/utils/nullstream.hpp> +#endif #ifdef DEBUG # define TEMPORARY_DEBUG_MACRO DEBUG Index: src/client/client.C =================================================================== --- src/client/client.C (Revision 14787) +++ src/client/client.C (Arbeitskopie) @@ -18,6 +18,7 @@ #include <boost/filesystem/operations.hpp> #include <boost/lexical_cast.hpp> #include <boost/scoped_ptr.hpp> +#include <boost/version.hpp> // getpid(), getppid() #ifdef HAVE_SYS_TYPES_H @@ -93,7 +94,11 @@ vector<fs::path> lyxSockets(string const for (; beg != end; ++beg) { if (prefixIs(beg->leaf(), "lyx_tmpdir" + pid)) { +#if BOOST_VERSION >= 103400 + fs::path lyxsocket = beg->path() / "lyxsocket"; +#else fs::path lyxsocket = *beg / "lyxsocket"; +#endif if (fs::exists(lyxsocket)) { dirlist.push_back(lyxsocket); }