From bee4a3c55296f15ca06cf6b1d3440ebb56064bc8 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Tue, 3 Jul 2007 01:14:18 +0000 Subject: [PATCH] lets us not need to alter hasher.hpp to compile --- libtorrent/include/libtorrent/hasher.hpp | 16 ++++++++++++++++ setup.py | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/libtorrent/include/libtorrent/hasher.hpp b/libtorrent/include/libtorrent/hasher.hpp index 990cbefd8..44faa6cf5 100755 --- a/libtorrent/include/libtorrent/hasher.hpp +++ b/libtorrent/include/libtorrent/hasher.hpp @@ -40,10 +40,25 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/config.hpp" #include "zlib.h" +#ifdef TORRENT_USE_OPENSSL extern "C" { #include } +#else +// from sha1.cpp +struct TORRENT_EXPORT SHA_CTX +{ + boost::uint32_t state[5]; + boost::uint32_t count[2]; + boost::uint8_t buffer[64]; +}; + +TORRENT_EXPORT void SHA1_Init(SHA_CTX* context); +TORRENT_EXPORT void SHA1_Update(SHA_CTX* context, boost::uint8_t const* data, boost::uint32_t len); +TORRENT_EXPORT void SHA1_Final(boost::uint8_t* digest, SHA_CTX* context); + +#endif namespace libtorrent { @@ -105,3 +120,4 @@ namespace libtorrent #endif // TORRENT_HASHER_HPP_INCLUDED + diff --git a/setup.py b/setup.py index 03e896e9a..a6b5179b7 100644 --- a/setup.py +++ b/setup.py @@ -96,7 +96,10 @@ python_version = platform.python_version()[0:3] # it has been removed to prevent confusion. if not OS == "win": - EXTRA_COMPILE_ARGS = ["-Wno-missing-braces"] + EXTRA_COMPILE_ARGS = ["-Wno-missing-braces", "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP=1", + "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP=1", + "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP=1", + "-DHAVE_PTHREAD=1", "-DTORRENT_USE_OPENSSL=1", "-DHAVE_SSL=1"] if ARCH == "x64": EXTRA_COMPILE_ARGS.append("-DAMD64") @@ -113,7 +116,7 @@ if not OS == "win": boosttype = 'nomt' else: boosttype = 'mt' - removals = ['-g', '-DNDEBUG', '-O2', '-Wstrict-prototypes'] + removals = ['-g', '-Wstrict-prototypes'] additions = ['-DNDEBUG', '-O2'] if python_version == '2.5':