*** empty log message ***

This commit is contained in:
Arvid Norberg
2005-07-02 02:11:18 +00:00
parent dab6063cfc
commit bd05d7e4bf
3 changed files with 43 additions and 18 deletions

View File

@@ -211,7 +211,7 @@ on how to do this <a class="reference" href="http://sourceforge.net/cvs/?group_i
correctly by setting the environment variable <tt class="docutils literal"><span class="pre">BOOST_BUILD_PATH</span></tt> to point to your boost build correctly by setting the environment variable <tt class="docutils literal"><span class="pre">BOOST_BUILD_PATH</span></tt> to point to your boost build
installation. Also you have to modify the <tt class="docutils literal"><span class="pre">user_config.jam</span></tt> to reflect the toolsets you have installed. installation. Also you have to modify the <tt class="docutils literal"><span class="pre">user_config.jam</span></tt> to reflect the toolsets you have installed.
(if you're building with gcc, uncomment the line &quot;using gcc ;&quot;)</p> (if you're building with gcc, uncomment the line &quot;using gcc ;&quot;)</p>
<p>You also need to install <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=284047">boost</a> (at least version 1.31.0).</p> <p>You also need to install <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=284047">boost</a> (at least version 1.32.0).</p>
<p>Before you invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> you have to set the environment variable <tt class="docutils literal"><span class="pre">BOOST_ROOT</span></tt> to the <p>Before you invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> you have to set the environment variable <tt class="docutils literal"><span class="pre">BOOST_ROOT</span></tt> to the
path where you installed boost. This will be used to build and link against the required path where you installed boost. This will be used to build and link against the required
boost libraries as well as be used as include path for boost headers.</p> boost libraries as well as be used as include path for boost headers.</p>
@@ -228,9 +228,7 @@ abstraction. There's one <tt class="docutils literal"><span class="pre">file_win
files larger than 2 Gigabytes. This does not work in vc6 for some reason, possibly because files larger than 2 Gigabytes. This does not work in vc6 for some reason, possibly because
it may require windows NT and above. The other file, <tt class="docutils literal"><span class="pre">file.cpp</span></tt> is the default it may require windows NT and above. The other file, <tt class="docutils literal"><span class="pre">file.cpp</span></tt> is the default
implementation that simply relies on the standard low level io routines (read, write etc.), implementation that simply relies on the standard low level io routines (read, write etc.),
this is the preferred implementation that should be used in all cases. The <tt class="docutils literal"><span class="pre">file_win.cpp</span></tt> this is the preferred implementation that should be used in all cases.</p>
have had some problems with failing seeks (I don't know why), so I advise everyone to use
the other file.</p>
<div class="section" id="cygwin-and-msvc"> <div class="section" id="cygwin-and-msvc">
<h2><a name="cygwin-and-msvc">cygwin and msvc</a></h2> <h2><a name="cygwin-and-msvc">cygwin and msvc</a></h2>
<p>Note that if you're building on windows using the <tt class="docutils literal"><span class="pre">msvc</span></tt> toolset, you cannot run it <p>Note that if you're building on windows using the <tt class="docutils literal"><span class="pre">msvc</span></tt> toolset, you cannot run it

View File

@@ -95,7 +95,7 @@ installation. Also you have to modify the ``user_config.jam`` to reflect the too
.. _`boost-build`: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=80982&release_id=278763 .. _`boost-build`: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=80982&release_id=278763
You also need to install boost__ (at least version 1.31.0). You also need to install boost__ (at least version 1.32.0).
__ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=284047 __ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=284047
@@ -121,9 +121,7 @@ abstraction. There's one ``file_win.cpp`` which relies on windows file API that
files larger than 2 Gigabytes. This does not work in vc6 for some reason, possibly because files larger than 2 Gigabytes. This does not work in vc6 for some reason, possibly because
it may require windows NT and above. The other file, ``file.cpp`` is the default it may require windows NT and above. The other file, ``file.cpp`` is the default
implementation that simply relies on the standard low level io routines (read, write etc.), implementation that simply relies on the standard low level io routines (read, write etc.),
this is the preferred implementation that should be used in all cases. The ``file_win.cpp`` this is the preferred implementation that should be used in all cases.
have had some problems with failing seeks (I don't know why), so I advise everyone to use
the other file.
cygwin and msvc cygwin and msvc

View File

@@ -55,17 +55,46 @@ namespace
HLOCAL m_memory; HLOCAL m_memory;
}; };
std::wstring safe_convert(std::string const& s)
{
try
{
return libtorrent::utf8_wchar(s);
}
catch (std::exception)
{
std::wstring ret;
for (const char* i = &*s.begin(); i < &*s.end(); ++i)
{
wchar_t c;
c = '.';
std::mbtowc(&c, i, 1);
ret += c;
}
return ret;
}
}
std::string utf8_native(std::string const& s) std::string utf8_native(std::string const& s)
{ {
std::wstring ws; try
libtorrent::utf8_wchar(s, ws); {
std::size_t size = wcstombs(0, ws.c_str(), 0); std::wstring ws;
if (size == std::size_t(-1)) return s; libtorrent::utf8_wchar(s, ws);
std::string ret; std::size_t size = wcstombs(0, ws.c_str(), 0);
ret.resize(size); if (size == std::size_t(-1)) return s;
size = wcstombs(&ret[0], ws.c_str(), size + 1); std::string ret;
ret.resize(size-1); ret.resize(size);
return ret; size = wcstombs(&ret[0], ws.c_str(), size + 1);
ret.resize(size-1);
return ret;
}
catch(std::exception)
{
return s;
}
} }
void throw_exception(const char* thrower) void throw_exception(const char* thrower)
@@ -135,7 +164,7 @@ namespace libtorrent
assert(access_mask & (GENERIC_READ | GENERIC_WRITE)); assert(access_mask & (GENERIC_READ | GENERIC_WRITE));
#ifdef UNICODE #ifdef UNICODE
std::wstring wfile_name(utf8_wchar(file_name)); std::wstring wfile_name(safe_convert(file_name));
HANDLE new_handle = CreateFile( HANDLE new_handle = CreateFile(
(LPCWSTR)wfile_name.c_str() (LPCWSTR)wfile_name.c_str()
, access_mask , access_mask