diff --git a/ed25519/src/ed25519.h b/ed25519/src/ed25519.h index bb34f893a..3d4f7cf1a 100644 --- a/ed25519/src/ed25519.h +++ b/ed25519/src/ed25519.h @@ -3,32 +3,21 @@ #include -#if defined(_WIN32) - #if defined(ED25519_BUILD_DLL) - #define ED25519_DECLSPEC __declspec(dllexport) - #elif defined(ED25519_DLL) - #define ED25519_DECLSPEC __declspec(dllimport) - #else - #define ED25519_DECLSPEC - #endif -#else - #define ED25519_DECLSPEC -#endif - +#include "libtorrent/config.hpp" #ifdef __cplusplus extern "C" { #endif #ifndef ED25519_NO_SEED -int ED25519_DECLSPEC ed25519_create_seed(unsigned char *seed); +int TORRENT_EXPORT ed25519_create_seed(unsigned char *seed); #endif -void ED25519_DECLSPEC ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed); -void ED25519_DECLSPEC ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key); -int ED25519_DECLSPEC ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *private_key); -void ED25519_DECLSPEC ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar); -void ED25519_DECLSPEC ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key); +void TORRENT_EXPORT ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed); +void TORRENT_EXPORT ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key); +int TORRENT_EXPORT ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *private_key); +void TORRENT_EXPORT ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar); +void TORRENT_EXPORT ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key); #ifdef __cplusplus diff --git a/test/Jamfile b/test/Jamfile index dbbdbdeb7..0daeb2ce3 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -12,19 +12,6 @@ exe enum_if : enum_if.cpp /torrent//torrent explicit test_natpmp ; explicit enum_if ; -ED25519_SOURCES = - add_scalar - fe - ge - key_exchange - keypair - sc - seed - sha512 - sign - verify - ; - rule link_test ( properties * ) { local result ; @@ -63,7 +50,6 @@ lib libtorrent_test dht_server.cpp udp_tracker.cpp peer_server.cpp - ../ed25519/src/$(ED25519_SOURCES).c web_seed_suite.cpp : # requirements diff --git a/tools/Jamfile b/tools/Jamfile index 0840e636f..31a0d4448 100644 --- a/tools/Jamfile +++ b/tools/Jamfile @@ -9,9 +9,26 @@ if $(BOOST_ROOT) use-project /boost : $(BOOST_ROOT) ; } +rule link_libtorrent ( properties * ) +{ + local result ; + if shared in $(properties) + { + result += + /torrent//torrent/shared/shared/on ; + } + else + { + result += + /torrent//torrent/static/static/on ; + } + return $(result) ; +} + project tools : requirements - multi /torrent//torrent + multi + @link_libtorrent : default-build static ; diff --git a/tools/dht_put.cpp b/tools/dht_put.cpp index efc3b6310..b3ec25a15 100644 --- a/tools/dht_put.cpp +++ b/tools/dht_put.cpp @@ -43,6 +43,16 @@ POSSIBILITY OF SUCH DAMAGE. using namespace libtorrent; +#ifdef TORRENT_DISABLE_DHT + +int main(int argc, char* argv[]) +{ + fprintf(stderr, "not built with DHT support\n"); + return 1; +} + +#else + void usage() { fprintf(stderr, @@ -313,3 +323,5 @@ int main(int argc, char* argv[]) fclose(f); } +#endif +