diff --git a/BeastConfig.h b/BeastConfig.h index d31678c8b4..42eb12b07b 100644 --- a/BeastConfig.h +++ b/BeastConfig.h @@ -22,9 +22,15 @@ // beast_basics flags -#ifndef BEAST_USE_BOOST -#define BEAST_USE_BOOST 0 -#endif +#define BEAST_USE_BOOST 1 + +// We bind functions that take references, which is +// unsupported on some platforms +// +// VFALCO TODO Rewrite functions to use pointers instead +// of references so we can get off boost::bind +// +//#define BEAST_BIND_USES_BOOST 1 #ifndef BEAST_USE_LEAKCHECKED #define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS diff --git a/Builds/VisualStudio2012/RippleD.props b/Builds/VisualStudio2012/RippleD.props index e97a5bdc9b..f7c80a55e4 100644 --- a/Builds/VisualStudio2012/RippleD.props +++ b/Builds/VisualStudio2012/RippleD.props @@ -12,7 +12,7 @@ - _WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions) + _VARIADIC_MAX=8;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions) true Level3 $(RepoDir);$(RepoDir)\src\cpp\protobuf\src;$(RepoDir)\src\cpp\protobuf\vsprojects;$(RepoDir)\build\proto;$(RepoDir)\Subtrees;$(RepoDir)\Subtrees\leveldb;$(RepoDir)\Subtrees\leveldb\include;$(RepoDir)\Subtrees\beast;%(AdditionalIncludeDirectories) diff --git a/TODO.txt b/TODO.txt index 29fce90d62..04fbd221e9 100644 --- a/TODO.txt +++ b/TODO.txt @@ -27,6 +27,9 @@ TODO - lift beast into the ripple namespace, remove ripple's duplicated integer types - lift unique_ptr / auto_ptr into ripple namespace, or replace with ScopedPointer +- Rewrite functions passed to bind to not take reference parameters, so we can + used std::bind instead of boost. + - Make LevelDB and Ripple code work with both Unicode and non-Unicode Windows APIs - Raise the warning level and fix everything diff --git a/modules/ripple_basics/utility/ripple_PlatformMacros.h b/modules/ripple_basics/utility/ripple_PlatformMacros.h index 86e081918e..75beb8aa9c 100644 --- a/modules/ripple_basics/utility/ripple_PlatformMacros.h +++ b/modules/ripple_basics/utility/ripple_PlatformMacros.h @@ -7,36 +7,30 @@ #ifndef RIPPLE_PLATFORMMACROS_H #define RIPPLE_PLATFORMMACROS_H +#define FUNCTION_TYPE beast::function +#define BIND_TYPE beast::bind +#define P_1 beast::_1 +#define P_2 beast::_2 +#define P_3 beast::_3 +#define P_4 beast::_4 + // VFALCO TODO Clean this up #if (!defined(FORCE_NO_C11X) && (__cplusplus > 201100L)) || defined(FORCE_C11X) -// VFALCO TODO replace BIND_TYPE with a namespace lift - +// VFALCO TODO Get rid of the C11X macro #define C11X #define UPTR_T std::unique_ptr #define MOVE_P(p) std::move(p) -#define BIND_TYPE std::bind -#define FUNCTION_TYPE std::function -#define P_1 std::placeholders::_1 -#define P_2 std::placeholders::_2 -#define P_3 std::placeholders::_3 -#define P_4 std::placeholders::_4 #else #define UPTR_T std::auto_ptr #define MOVE_P(p) (p) -#define BIND_TYPE boost::bind -#define FUNCTION_TYPE boost::function -#define P_1 _1 -#define P_2 _2 -#define P_3 _3 -#define P_4 _4 #endif -// VFALCO TODO Clean this junk up +// VFALCO TODO Clean this stuff up. Remove as much as possible #define nothing() do {} while (0) #define fallthru() do {} while (0) #define NUMBER(x) (sizeof(x)/sizeof((x)[0])) diff --git a/modules/ripple_core/functional/ripple_JobQueue.h b/modules/ripple_core/functional/ripple_JobQueue.h index 3c4f80d173..6526f90b32 100644 --- a/modules/ripple_core/functional/ripple_JobQueue.h +++ b/modules/ripple_core/functional/ripple_JobQueue.h @@ -12,6 +12,9 @@ class JobQueue public: explicit JobQueue (boost::asio::io_service&); + // VFALCO TODO make convenience functions that allow the caller to not + // have to call bind. + // void addJob (JobType type, const std::string& name, const FUNCTION_TYPE& job); int getJobCount (JobType t); // Jobs waiting at this priority diff --git a/src/cpp/ripple/CallRPC.h b/src/cpp/ripple/CallRPC.h index 3bfefe7d03..bb0d2cf1e6 100644 --- a/src/cpp/ripple/CallRPC.h +++ b/src/cpp/ripple/CallRPC.h @@ -66,7 +66,7 @@ extern void callRPC ( const std::string& strUsername, const std::string& strPassword, const std::string& strPath, const std::string& strMethod, const Json::Value& jvParams, const bool bSSL, - FUNCTION_TYPE callbackFuncP = 0); + FUNCTION_TYPE callbackFuncP = FUNCTION_TYPE ()); #endif // vim:ts=4 diff --git a/src/cpp/ripple/ripple_Peer.cpp b/src/cpp/ripple/ripple_Peer.cpp index 279f4757fe..f1d862e935 100644 --- a/src/cpp/ripple/ripple_Peer.cpp +++ b/src/cpp/ripple/ripple_Peer.cpp @@ -1285,6 +1285,10 @@ void PeerImp::recvHaveTxSet (protocol::TMHaveTransactionSet& packet) } uint256 hash; + + // VFALCO TODO There should be no use of memcpy() throughout the program. + // TODO Clean up this magic number + // memcpy (hash.begin (), packet.hash ().data (), 32); if (packet.status () == protocol::tsHAVE)