diff --git a/bindings/python/src/module.cpp b/bindings/python/src/module.cpp index 47576889d..3168488e6 100644 --- a/bindings/python/src/module.cpp +++ b/bindings/python/src/module.cpp @@ -6,6 +6,7 @@ #define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1 #endif +#include "libtorrent/config.hpp" #include 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(); diff --git a/bindings/python/src/string.cpp b/bindings/python/src/string.cpp index bb133bfd0..bac69af83 100644 --- a/bindings/python/src/string.cpp +++ b/bindings/python/src/string.cpp @@ -3,10 +3,14 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include +#include "libtorrent/config.hpp" #include "libtorrent/utf8.hpp" #include +#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 + diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index f324602e0..7b7c5fc16 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -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