Use beast for bind, placeholders, and function

This commit is contained in:
Vinnie Falco
2013-06-28 14:28:25 -07:00
parent df9fa7b897
commit 8f7acfe4ee
2 changed files with 14 additions and 21 deletions

View File

@@ -24,13 +24,12 @@
#define BEAST_USE_BOOST 1
// We bind functions that take references, which is
// unsupported on some platforms
// VFALCO TODO Fix this hack for using boost on FreeBSD
// We need to enforce a minimum library/g++ version.
//
// VFALCO TODO Rewrite functions to use pointers instead
// of references so we can get off boost::bind
//
//#define BEAST_BIND_USES_BOOST 1
#if __FreeBSD__
#define BEAST_BIND_USES_BOOST 1
#endif
#ifndef BEAST_USE_LEAKCHECKED
#define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS

View File

@@ -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]))