Better way to test on BOOST_FILESYSTEM_VERSION
This way it also compiles with older versions that don't define BOOST_FILESYSTEM_VERSION (ie, 1.42).
This commit is contained in:
@@ -63,10 +63,10 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
|
||||
{
|
||||
mIter = fs::directory_iterator(dir_path);
|
||||
}
|
||||
#if BOOST_FILESYSTEM_VERSION == 2
|
||||
catch (fs::basic_filesystem_error<fs::path>& e)
|
||||
#else
|
||||
#if BOOST_FILESYSTEM_VERSION >= 3
|
||||
catch (fs::filesystem_error& e)
|
||||
#else
|
||||
catch (fs::basic_filesystem_error<fs::path>& e)
|
||||
#endif
|
||||
{
|
||||
llerrs << e.what() << llendl;
|
||||
@@ -112,10 +112,10 @@ bool LLDirIterator::Impl::next(std::string &fname)
|
||||
while (mIter != end_itr && !found)
|
||||
{
|
||||
boost::smatch match;
|
||||
#if BOOST_FILESYSTEM_VERSION == 2
|
||||
std::string name = mIter->path().filename();
|
||||
#else
|
||||
#if BOOST_FILESYSTEM_VERSION >= 3
|
||||
std::string name = mIter->path().filename().string();
|
||||
#else
|
||||
std::string name = mIter->path().filename();
|
||||
#endif
|
||||
if (found = boost::regex_match(name, match, mFilterExp))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user