diff --git a/CMakeLists.txt b/CMakeLists.txt index 81ac443..0fbd5ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,7 +149,7 @@ set( fc_sources src/crypto/elliptic.cpp src/crypto/rand.cpp src/crypto/salsa20.cpp - src/crypto/scrypt.cpp + #src/crypto/scrypt.cpp src/crypto/romix.cpp src/network/tcp_socket.cpp src/network/udp_socket.cpp @@ -166,7 +166,7 @@ set( fc_sources src/compress/lzma.cpp vendor/cyoencode-1.0.2/src/CyoDecode.c vendor/cyoencode-1.0.2/src/CyoEncode.c -# vendor/salsa20/ecrypt.c + #vendor/salsa20/ecrypt.c ${SALSA_SRC} ) @@ -186,7 +186,7 @@ list(APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp") list(APPEND sources ${fc_headers}) add_subdirectory( vendor/easylzma ) -add_subdirectory( vendor/scrypt-jane ) +#add_subdirectory( vendor/scrypt-jane ) add_subdirectory( vendor/udt4 ) setup_library( fc SOURCES ${sources} LIBRARY_TYPE STATIC DONT_INSTALL_LIBRARY ) @@ -219,7 +219,7 @@ target_include_directories(fc ${OPENSSL_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/vendor/scrypt-jane + #${CMAKE_CURRENT_SOURCE_DIR}/vendor/scrypt-jane ${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include ${CMAKE_CURRENT_SOURCE_DIR}/vendor/salsa20 @@ -227,7 +227,8 @@ target_include_directories(fc ${CMAKE_CURRENT_SOURCE_DIR}/vendor/udt4/src ) -target_link_libraries( fc PUBLIC easylzma_static scrypt udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library}) +#target_link_libraries( fc PUBLIC easylzma_static scrypt udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library}) +target_link_libraries( fc PUBLIC easylzma_static udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library}) add_executable( ntp_test ntp_test.cpp ) target_link_libraries( ntp_test fc ) @@ -343,6 +344,13 @@ if(WIN32) endif(WIN32) +if(APPLE) + find_package( ZLIB REQUIRED ) + if ( ZLIB_FOUND ) + target_link_libraries( fc PUBLIC ${ZLIB_LIBRARIES} ) + endif() +endif() + SET(OPENSSL_CONF_TARGET ) IF(DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) SET (OPENSSL_CONF_TARGET ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index f05f00a..8aa5558 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include @@ -6,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/include/fc/io/raw_variant.hpp b/include/fc/io/raw_variant.hpp index 8abb376..24fe3f6 100644 --- a/include/fc/io/raw_variant.hpp +++ b/include/fc/io/raw_variant.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include diff --git a/include/fc/rpc/json_connection.hpp b/include/fc/rpc/json_connection.hpp index fb37792..dd8aba3 100644 --- a/include/fc/rpc/json_connection.hpp +++ b/include/fc/rpc/json_connection.hpp @@ -205,7 +205,55 @@ namespace fc { namespace rpc { const variant& a7, microseconds timeout = microseconds::maximum()) { - return async_call( method, a1, a2, a3, a4, a5, a6,7).wait(timeout).as(); + return async_call( method, a1, a2, a3, a4, a5, a6, a7).wait(timeout).as(); + } + + template + Result call( const fc::string& method, + const variant& a1, + const variant& a2, + const variant& a3, + const variant& a4, + const variant& a5, + const variant& a6, + const variant& a7, + const variant& a8, + microseconds timeout = microseconds::maximum()) + { + return async_call( method, a1, a2, a3, a4, a5, a6, a7, a8).wait(timeout).as(); + } + + template + Result call( const fc::string& method, + const variant& a1, + const variant& a2, + const variant& a3, + const variant& a4, + const variant& a5, + const variant& a6, + const variant& a7, + const variant& a8, + const variant& a9, + microseconds timeout = microseconds::maximum()) + { + return async_call( method, a1, a2, a3, a4, a5, a6, a7, a8, a9).wait(timeout).as(); + } + + template + Result call( const fc::string& method, + const variant& a1, + const variant& a2, + const variant& a3, + const variant& a4, + const variant& a5, + const variant& a6, + const variant& a7, + const variant& a8, + const variant& a9, + const variant& a10, + microseconds timeout = microseconds::maximum()) + { + return async_call( method, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10).wait(timeout).as(); } template diff --git a/include/fc/thread/thread.hpp b/include/fc/thread/thread.hpp index 2aceb5e..040d877 100644 --- a/include/fc/thread/thread.hpp +++ b/include/fc/thread/thread.hpp @@ -1,4 +1,7 @@ #pragma once + +#define FC_CONTEXT_STACK_SIZE (2048*1024) + #include #include #include diff --git a/src/thread/context.hpp b/src/thread/context.hpp index f7d15e9..f6e8a77 100644 --- a/src/thread/context.hpp +++ b/src/thread/context.hpp @@ -64,19 +64,19 @@ namespace fc { context_posted_num(0) { #if BOOST_VERSION >= 105600 - size_t stack_size = stack_allocator::traits_type::default_size() * 4; + size_t stack_size = FC_CONTEXT_STACK_SIZE; alloc.allocate(stack_ctx, stack_size); my_context = bc::make_fcontext( stack_ctx.sp, stack_ctx.size, sf); #elif BOOST_VERSION >= 105400 - size_t stack_size = bco::stack_allocator::default_stacksize() * 4; + size_t stack_size = FC_CONTEXT_STACK_SIZE; alloc.allocate(stack_ctx, stack_size); my_context = bc::make_fcontext( stack_ctx.sp, stack_ctx.size, sf); #elif BOOST_VERSION >= 105300 - size_t stack_size = bco::stack_allocator::default_stacksize() * 4; + size_t stack_size = FC_CONTEXT_STACK_SIZE; void* stackptr = alloc.allocate(stack_size); my_context = bc::make_fcontext( stackptr, stack_size, sf); #else - size_t stack_size = bc::default_stacksize() * 4; + size_t stack_size = FC_CONTEXT_STACK_SIZE; my_context.fc_stack.base = alloc.allocate( stack_size ); my_context.fc_stack.limit = static_cast( my_context.fc_stack.base) - stack_size; make_fcontext( &my_context, sf ); @@ -115,12 +115,12 @@ namespace fc { delete my_context; #elif BOOST_VERSION >= 105300 if(stack_alloc) - stack_alloc->deallocate( my_context->fc_stack.sp, stack_allocator::default_stacksize() * 4); + stack_alloc->deallocate( my_context->fc_stack.sp, FC_CONTEXT_STACK_SIZE); else delete my_context; #else if(stack_alloc) - stack_alloc->deallocate( my_context.fc_stack.base, bc::default_stacksize() ); + stack_alloc->deallocate( my_context.fc_stack.base, FC_CONTEXT_STACK_SIZE ); #endif }