All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

OPEN-67: make LLDirIterator implementation compatible to boost::filesystem v3 (as found in Boost 1.44 and newer)

Review Request #313 - Created May 25, 2011 and updated

Boroondas Gupte Reviewers
viewer
OPEN-67
None viewer-development
Context: We are currently using Boost 1.45, which already comes with the new Boost Filesystem Library API (Version 3) but still defaults to the old one (Version 2). From Boost 1.46 on, V3 will be the default and Boost 1.47 will be the last one to come with V2. The Boost Filesystem Library documentation recommends "Existing code should be moved to Version 3 as soon as convenient. New code should be written for Version 3. Version 2 is deprecated, and will not be included in Boost releases 1.48 and later."

This change overrides the default, so that the V3 API is used, and makes the necessary code changes. (So we can stick to Boost 1.45 and upgrade whenever we feel like it.)

Note: I only changed stuff that the compiler complained about. If the new API also changes semantic of still-compiling library usage, more changes might be necessary.
* Compiled Viewer (standalone) with Boost 1.45
* Started Viewer
* Logged in

* Compiled Viewer (standalone) with Boost 1.46
* Started Viewer
* Logged in

Not tested:
* non-standalone
Review request changed
Updated (July 21, 2011, 8:43 a.m.)
Omit directory separator conversion, which is unnecessary for "paths" that are only filenames.
Posted (July 21, 2011, 1:29 p.m.)
applied open-67_d.diff @r15984; windows fails link with unresolved externals as follows:
"windows-crash-logger.dir\RelWithDebInfo\/win_crash_logger.obj"  /machine:X86 /debug 
llvfs.lib(lldiriterator.obj) : error LNK2019: unresolved external symbol "private: static class std::codecvt<unsigned short,char,int> const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(void)" (?wchar_t_codecvt_facet@path@filesystem3@boost@@CAAAPBV?$codecvt@GDH@std@@XZ) referenced in function "public: __thiscall LLDirIterator::Impl::Impl(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Impl@LLDirIterator@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [c:\Users\Bill\lindenhg\viewer-development-mesh\build-vc100\win_crash_logger\windows-crash-logger.vcxproj]
llvfs.lib(lldiriterator.obj) : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem3::path_traits::convert(unsigned short const *,unsigned short const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::codecvt<unsigned short,char,int> const &)" (?convert@path_traits@filesystem3@boost@@YAXPBG0AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$codecvt@GDH@5@@Z) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const __thiscall boost::filesystem3::path::string(class std::codecvt<unsigned short,char,int> const &)const " (?string@path@filesystem3@boost@@QBE?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$codecvt@GDH@5@@Z) [c:\Users\Bill\lindenhg\viewer-development-mesh\build-vc100\win_crash_logger\windows-crash-logger.vcxproj]
llvfs.lib(lldiriterator.obj) : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const __thiscall boost::filesystem3::path::generic_string(class std::codecvt<unsigned short,char,int> const &)const " (?generic_string@path@filesystem3@boost@@QBE?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$codecvt@GDH@5@@Z) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const __thiscall boost::filesystem3::path::generic_string(void)const " (?generic_string@path@filesystem3@boost@@QBE?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) [c:\Users\Bill\lindenhg\viewer-development-mesh\build-vc100\win_crash_logger\windows-crash-logger.vcxproj]
llvfs.lib(lldiriterator.obj) : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem3::path_traits::convert(char const *,char const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &,class std::codecvt<unsigned short,char,int> const &)" (?convert@path_traits@filesystem3@boost@@YAXPBD0AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@ABV?$codecvt@GDH@5@@Z) referenced in function "void __cdecl boost::filesystem3::path_traits::dispatch<class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &,class std::codecvt<unsigned short,char,int> const &)" (??$dispatch@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@path_traits@filesystem3@boost@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@4@ABV?$codecvt@GDH@4@@Z) [c:\Users\Bill\lindenhg\viewer-development-mesh\build-vc100\win_crash_logger\windows-crash-logger.vcxproj]
  1. Did the patch apply cleanly? To maintain readability, I didn't include the merge with tip, so you might want to pull https://bitbucket.org/boroondas/viewer-development-open-67 instead of manually applying patches.
  2. Just saw that you mentioned a revision: 15984
    
    Though, this is a revision number, thus valid for the local repository only. What is the corresponding revision ID?
Posted (July 21, 2011, 6:24 p.m.)
Hash was 216ebc0442d29a8ba4a66ae8c7211b7aaa225892. However, the result is the same when building a clone of https://bitbucket.org/boroondas/viewer-development-open-67. I'll try to sort out a solution as time allows. Maybe another windows developer can pitch in.
Posted (July 23, 2011, 9:53 a.m.)
https://bitbucket.org/lindenlab/viewer-development/changeset/a0b400b5ff0e/ The comments in this changeset describe the windows build / link issues for this CR.