Merge branch 'master' of github.com:BitShares/fc
This commit is contained in:
commit
cb66666edd
6 changed files with 73 additions and 13 deletions
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include <fc/io/raw_variant.hpp>
|
||||
#include <fc/reflect/reflect.hpp>
|
||||
#include <fc/io/datastream.hpp>
|
||||
#include <fc/io/varint.hpp>
|
||||
|
|
@ -6,7 +7,6 @@
|
|||
#include <fc/fwd.hpp>
|
||||
#include <fc/array.hpp>
|
||||
#include <fc/time.hpp>
|
||||
#include <fc/io/raw_fwd.hpp>
|
||||
#include <fc/filesystem.hpp>
|
||||
#include <fc/exception/exception.hpp>
|
||||
#include <map>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include <fc/exception/exception.hpp>
|
||||
#include <fc/io/raw_fwd.hpp>
|
||||
#include <fc/variant_object.hpp>
|
||||
#include <fc/variant.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<Result>();
|
||||
return async_call( method, a1, a2, a3, a4, a5, a6, a7).wait(timeout).as<Result>();
|
||||
}
|
||||
|
||||
template<typename Result>
|
||||
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<Result>();
|
||||
}
|
||||
|
||||
template<typename Result>
|
||||
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<Result>();
|
||||
}
|
||||
|
||||
template<typename Result>
|
||||
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<Result>();
|
||||
}
|
||||
|
||||
template<typename Result>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#define FC_CONTEXT_STACK_SIZE (2048*1024)
|
||||
|
||||
#include <fc/thread/task.hpp>
|
||||
#include <fc/vector.hpp>
|
||||
#include <fc/string.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<char*>( 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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue