merged utf8 conversion fix from RC_0_16

This commit is contained in:
Arvid Norberg 2012-11-30 05:26:09 +00:00
parent 00c1017f16
commit c065b1fa80
3 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,7 @@
#define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1
#endif
#include "libtorrent/config.hpp"
#include <boost/python/module.hpp>
void bind_utility();
@ -41,7 +42,9 @@ BOOST_PYTHON_MODULE(libtorrent)
bind_entry();
bind_session();
bind_torrent_info();
#if TORRENT_USE_WSTRING
bind_unicode_string_conversion();
#endif
bind_torrent_handle();
bind_torrent_status();
bind_session_settings();

View File

@ -3,10 +3,14 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/python.hpp>
#include "libtorrent/config.hpp"
#include "libtorrent/utf8.hpp"
#include <string>
#if TORRENT_USE_WSTRING
using namespace boost::python;
using namespace libtorrent;
struct unicode_from_python
{
@ -69,3 +73,5 @@ void bind_unicode_string_conversion()
unicode_from_python();
}
#endif // TORRENT_USE_WSTRING

View File

@ -377,11 +377,11 @@ inline int snprintf(char* buf, int len, char const* fmt, ...)
#endif
#ifndef TORRENT_USE_WSTRING
#if defined UNICODE && !defined BOOST_NO_STD_WSTRING
#if !defined BOOST_NO_STD_WSTRING
#define TORRENT_USE_WSTRING 1
#else
#define TORRENT_USE_WSTRING 0
#endif // UNICODE
#endif // BOOST_NO_STD_WSTRING
#endif // TORRENT_USE_WSTRING
#ifndef TORRENT_HAS_FALLOCATE