mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 06:55:50 +00:00
Add BeforeBoost.h and tidy up beast system headers
This commit is contained in:
@@ -196,7 +196,7 @@ namespace beast
|
||||
#include "streams/beast_OutputStream.cpp"
|
||||
#include "streams/beast_SubregionStream.cpp"
|
||||
|
||||
#include "system/beast_SystemStats.cpp"
|
||||
#include "system/SystemStats.cpp"
|
||||
|
||||
#include "text/beast_CharacterFunctions.cpp"
|
||||
#include "text/beast_LexicalCast.cpp"
|
||||
@@ -318,18 +318,5 @@ namespace beast
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_BOOST_IS_AVAILABLE
|
||||
namespace boost {
|
||||
namespace placeholders {
|
||||
boost::arg<1> _1;
|
||||
boost::arg<2> _2;
|
||||
boost::arg<3> _3;
|
||||
boost::arg<4> _4;
|
||||
boost::arg<5> _5;
|
||||
boost::arg<6> _6;
|
||||
boost::arg<7> _7;
|
||||
boost::arg<8> _8;
|
||||
boost::arg<9> _9;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Must be outside the namespace
|
||||
#include "system/BoostPlaceholdersFix.cpp"
|
||||
|
||||
@@ -172,101 +172,11 @@ Some files contain portions of these external projects, licensed separately:
|
||||
@copyright Provided under the [ISC LIcense][11]
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
# include "system/BeforeBoost.h"
|
||||
# include "system/BoostIncludes.h"
|
||||
#include "system/FunctionalIncludes.h"
|
||||
|
||||
/** Implementation classes.
|
||||
|
||||
Thase classes are used internally.
|
||||
|
||||
@defgroup internal internal
|
||||
@internal
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** External modules.
|
||||
|
||||
These modules bring in functionality from third party or system libraries.
|
||||
|
||||
@defgroup external external
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Core classes.
|
||||
|
||||
This module provides core required functionality, and classes useful for
|
||||
general development. All other modules require this module.
|
||||
|
||||
@todo Discuss the treatment of exceptions versus Error objects in the
|
||||
library.
|
||||
|
||||
@todo Discuss the additions to BeastConfig.h
|
||||
|
||||
@defgroup beast_core beast_core
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/* If you fail to make sure that all your compile units are building Beast with
|
||||
the same set of option flags, then there's a risk that different compile
|
||||
units will treat the classes as having different memory layouts, leading to
|
||||
very nasty memory corruption errors when they all get linked together.
|
||||
That's why it's best to always include the BeastConfig.h file before any
|
||||
beast headers.
|
||||
*/
|
||||
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
|
||||
# ifdef _MSC_VER
|
||||
# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?")
|
||||
# else
|
||||
# warning "Have you included your BeastConfig.h file before including the Beast headers?"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "system/beast_TargetPlatform.h"
|
||||
|
||||
//
|
||||
// Apply sensible defaults for the configuration settings
|
||||
//
|
||||
|
||||
#ifndef BEAST_LOG_ASSERTIONS
|
||||
# if BEAST_ANDROID
|
||||
# define BEAST_LOG_ASSERTIONS 1
|
||||
# else
|
||||
# define BEAST_LOG_ASSERTIONS 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS)
|
||||
#define BEAST_CHECK_MEMORY_LEAKS 1
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_INCLUDE_ZLIB_CODE
|
||||
#define BEAST_INCLUDE_ZLIB_CODE 1
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_ZLIB_INCLUDE_PATH
|
||||
#define BEAST_ZLIB_INCLUDE_PATH <zlib.h>
|
||||
#endif
|
||||
|
||||
/* Config: BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||
If enabled, this will add some exception-catching code to forward unhandled exceptions
|
||||
to your BEASTApplication::unhandledException() callback.
|
||||
*/
|
||||
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||
//#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_STRING_UTF_TYPE
|
||||
# define BEAST_STRING_UTF_TYPE 8
|
||||
#endif
|
||||
|
||||
#include "system/BoostIncludes.h"
|
||||
#include "system/BindIncludes.h"
|
||||
|
||||
#include "system/beast_StandardHeader.h"
|
||||
#include "system/StandardHeader.h"
|
||||
|
||||
#if BEAST_MSVC
|
||||
# pragma warning (disable: 4251) // (DLL build warning, must be disabled before pushing the warning state)
|
||||
@@ -346,10 +256,10 @@ extern BEAST_API void BEAST_CALLTYPE logAssertion (char const* file, int line) n
|
||||
# pragma warning (pop)
|
||||
#endif
|
||||
|
||||
#include "system/beast_PlatformDefs.h"
|
||||
#include "system/beast_TargetPlatform.h"
|
||||
#include "system/PlatformDefs.h"
|
||||
#include "system/TargetPlatform.h"
|
||||
#include "diagnostic/beast_Throw.h"
|
||||
#include "system/beast_Functional.h"
|
||||
#include "system/Functional.h"
|
||||
#include "memory/beast_AtomicCounter.h"
|
||||
#include "memory/beast_AtomicFlag.h"
|
||||
#include "memory/beast_AtomicPointer.h"
|
||||
@@ -449,7 +359,7 @@ extern BEAST_API void BEAST_CALLTYPE logAssertion (char const* file, int line) n
|
||||
#include "streams/beast_OutputStream.h"
|
||||
#include "streams/beast_SubregionStream.h"
|
||||
|
||||
#include "system/beast_SystemStats.h"
|
||||
#include "system/SystemStats.h"
|
||||
#include "text/beast_Identifier.h"
|
||||
#include "text/beast_LocalisedStrings.h"
|
||||
#include "text/beast_NewLine.h"
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
/** Writes a message to the standard error stream.
|
||||
|
||||
This can be called directly, or by using the DBG() macro in
|
||||
beast_PlatformDefs.h (which will avoid calling the method in non-debug builds).
|
||||
PlatformDefs.h (which will avoid calling the method in non-debug builds).
|
||||
*/
|
||||
static void BEAST_CALLTYPE outputDebugString (const String& text);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// implementation has a leak. Although the other
|
||||
// one also seems to have a leak.
|
||||
//
|
||||
//#if BEAST_BOOST_IS_AVAILABLE
|
||||
//#if BEAST_USE_BOOST_FEATURES
|
||||
#if 0
|
||||
typedef FifoFreeStoreWithTLS FifoFreeStoreType;
|
||||
#else
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
// affecting performance.
|
||||
//
|
||||
|
||||
#if BEAST_BOOST_IS_AVAILABLE
|
||||
#if BEAST_USE_BOOST_FEATURES
|
||||
|
||||
// This precedes every allocation
|
||||
//
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef BEAST_FIFOFREESTOREWITHTLS_H_INCLUDED
|
||||
#define BEAST_FIFOFREESTOREWITHTLS_H_INCLUDED
|
||||
|
||||
#if BEAST_BOOST_IS_AVAILABLE
|
||||
#if BEAST_USE_BOOST_FEATURES
|
||||
|
||||
/*============================================================================*/
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef BEAST_BASICNATIVEHEADERS_H_INCLUDED
|
||||
#define BEAST_BASICNATIVEHEADERS_H_INCLUDED
|
||||
|
||||
#include "../system/beast_TargetPlatform.h"
|
||||
#include "../system/TargetPlatform.h"
|
||||
#undef T
|
||||
|
||||
//==============================================================================
|
||||
|
||||
102
Subtrees/beast/modules/beast_core/system/BeastConfigCheck.h
Normal file
102
Subtrees/beast/modules/beast_core/system/BeastConfigCheck.h
Normal file
@@ -0,0 +1,102 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CORE_SYSTEM_BEASTCONFIGCHECK_H_INCLUDED
|
||||
#define BEAST_CORE_SYSTEM_BEASTCONFIGCHECK_H_INCLUDED
|
||||
|
||||
// This file makes sure that BeastConfig.h was included.
|
||||
// It also sets defaults for all config options.
|
||||
|
||||
/* If you fail to make sure that all your compile units are building Beast with
|
||||
the same set of option flags, then there's a risk that different compile
|
||||
units will treat the classes as having different memory layouts, leading to
|
||||
very nasty memory corruption errors when they all get linked together.
|
||||
That's why it's best to always include the BeastConfig.h file before any
|
||||
beast headers.
|
||||
*/
|
||||
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
|
||||
# ifdef _MSC_VER
|
||||
# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?")
|
||||
# else
|
||||
# warning "Have you included your BeastConfig.h file before including the Beast headers?"
|
||||
# endif
|
||||
# error "BeastConfig.h must be included before any Beast headers!"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Apply sensible defaults for the configuration settings
|
||||
//
|
||||
|
||||
#ifndef BEAST_FORCE_DEBUG
|
||||
#define BEAST_FORCE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_LOG_ASSERTIONS
|
||||
# if BEAST_ANDROID
|
||||
# define BEAST_LOG_ASSERTIONS 1
|
||||
# else
|
||||
# define BEAST_LOG_ASSERTIONS 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
|
||||
#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1
|
||||
#endif
|
||||
|
||||
#if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS)
|
||||
#define BEAST_CHECK_MEMORY_LEAKS 1
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_DISABLE_CONTRACT_CHECKS
|
||||
#define BEAST_DISABLE_CONTRACT_CHECKS 0
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
|
||||
#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 0
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef BEAST_DISABLE_BEAST_VERSION_PRINTING
|
||||
#define BEAST_DISABLE_BEAST_VERSION_PRINTING 0
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
|
||||
#define BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES 0
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_INCLUDE_ZLIB_CODE
|
||||
#define BEAST_INCLUDE_ZLIB_CODE 1
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_ZLIB_INCLUDE_PATH
|
||||
#define BEAST_ZLIB_INCLUDE_PATH <zlib.h>
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_STRING_UTF_TYPE
|
||||
#define BEAST_STRING_UTF_TYPE 8
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifndef BEAST_USE_BOOST_FEATURES
|
||||
#define BEAST_USE_BOOST_FEATURES 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
82
Subtrees/beast/modules/beast_core/system/BeforeBoost.h
Normal file
82
Subtrees/beast/modules/beast_core/system/BeforeBoost.h
Normal file
@@ -0,0 +1,82 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CORE_SYSTEM_BEFOREBOOST_H_INCLUDED
|
||||
#define BEAST_CORE_SYSTEM_BEFOREBOOST_H_INCLUDED
|
||||
|
||||
// This file should be included before including any boost headers.
|
||||
// If you don't include this file, and you include boost headers,
|
||||
// Beast will generate a compile error with an explanation of why.
|
||||
|
||||
#include "TargetPlatform.h"
|
||||
|
||||
#include "BeastConfigCheck.h"
|
||||
|
||||
#if BEAST_USE_BOOST_FEATURES
|
||||
|
||||
// Prevent <boost/bind/placeholders.hpp> from being included
|
||||
#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
# error "boost/bind.hpp must not be included before this file"
|
||||
#else
|
||||
# define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/thread/tss.hpp> // for FifoFreeStoreWithTLS
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#if BOOST_VERSION > 105499
|
||||
# error "This hasnt been tested with boost versions above 1.54"
|
||||
#endif
|
||||
|
||||
// This is a hack to fix boost's goofy placeholders going into the global
|
||||
// namespace. First we prevent the user from including boost/bind.hpp
|
||||
// before us. Then we define the include guard macro and include
|
||||
// boost/bind.hpp ourselves to get the declarations. Finally we repeat
|
||||
// the missing placeholder declarations but put them in a proper namespace.
|
||||
//
|
||||
// We put the placeholders in boost::placeholders so they can be accessed
|
||||
// explicitly to handle the common case of a "using namespace oost" directive
|
||||
// being in effect.
|
||||
//
|
||||
// Declarations based on boost/bind/placeholders.cpp
|
||||
//
|
||||
namespace boost {
|
||||
namespace placeholders {
|
||||
extern boost::arg<1> _1;
|
||||
extern boost::arg<2> _2;
|
||||
extern boost::arg<3> _3;
|
||||
extern boost::arg<4> _4;
|
||||
extern boost::arg<5> _5;
|
||||
extern boost::arg<6> _6;
|
||||
extern boost::arg<7> _7;
|
||||
extern boost::arg<8> _8;
|
||||
extern boost::arg<9> _9;
|
||||
}
|
||||
using namespace placeholders;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
@@ -3,10 +3,6 @@
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Portions of this file are from JUCE.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
Please visit http://www.juce.com
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
@@ -24,63 +20,13 @@
|
||||
#ifndef BEAST_CORE_SYSTEM_BOOSTINCLUDES_H_INCLUDED
|
||||
#define BEAST_CORE_SYSTEM_BOOSTINCLUDES_H_INCLUDED
|
||||
|
||||
// If boost is available we activate some boost-specific features.
|
||||
//
|
||||
#ifndef BEAST_BOOST_IS_AVAILABLE
|
||||
# define BEAST_BOOST_IS_AVAILABLE 0
|
||||
#endif
|
||||
#if BEAST_USE_BOOST_FEATURES
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_BOOST_IS_AVAILABLE
|
||||
|
||||
// Prevent <boost/bind/placeholders.hpp> from being included
|
||||
#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
# error "boost/bind.hpp must not be included before this file"
|
||||
#else
|
||||
# define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/thread/tss.hpp> // for FifoFreeStoreWithTLS
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#if BOOST_VERSION > 105499
|
||||
# error "This hasnt been tested with boost versions above 1.54"
|
||||
#endif
|
||||
|
||||
// This is a hack to fix boost's goofy placeholders going into the global
|
||||
// namespace. First we prevent the user from including boost/bind.hpp
|
||||
// before us. Then we define the include guard macro and include
|
||||
// boost/bind.hpp ourselves to get the declarations. Finally we repeat
|
||||
// the missing placeholder declarations but put them in a proper namespace.
|
||||
//
|
||||
// We put the placeholders in boost::placeholders so they can be accessed
|
||||
// explicitly to handle the common case of a "using namespace oost" directive
|
||||
// being in effect.
|
||||
//
|
||||
// Declarations based on boost/bind/placeholders.cpp
|
||||
//
|
||||
namespace boost {
|
||||
namespace placeholders {
|
||||
extern boost::arg<1> _1;
|
||||
extern boost::arg<2> _2;
|
||||
extern boost::arg<3> _3;
|
||||
extern boost::arg<4> _4;
|
||||
extern boost::arg<5> _5;
|
||||
extern boost::arg<6> _6;
|
||||
extern boost::arg<7> _7;
|
||||
extern boost::arg<8> _8;
|
||||
extern boost::arg<9> _9;
|
||||
}
|
||||
using namespace placeholders;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#if BEAST_USE_BOOST_FEATURES
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace placeholders
|
||||
{
|
||||
|
||||
boost::arg<1> _1;
|
||||
boost::arg<2> _2;
|
||||
boost::arg<3> _3;
|
||||
boost::arg<4> _4;
|
||||
boost::arg<5> _5;
|
||||
boost::arg<6> _6;
|
||||
boost::arg<7> _7;
|
||||
boost::arg<8> _8;
|
||||
boost::arg<9> _9;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CORE_SYSTEM_BOOSTPLACEHOLDERSFIX_H_INCLUDED
|
||||
#define BEAST_CORE_SYSTEM_BOOSTPLACEHOLDERSFIX_H_INCLUDED
|
||||
|
||||
#if BEAST_USE_BOOST_FEATURES
|
||||
|
||||
// Prevent <boost/bind/placeholders.hpp> from being included
|
||||
#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
# error "boost/bind.hpp must not be included before this file"
|
||||
#else
|
||||
# define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
#endif
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#if BOOST_VERSION > 105499
|
||||
# error "This hasnt been tested with boost versions above 1.54"
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
|
||||
// This is a hack to fix boost's goofy placeholders going into the global
|
||||
// namespace. First we prevent the user from including boost/bind.hpp
|
||||
// before us. Then we define the include guard macro and include
|
||||
// boost/bind.hpp ourselves to get the declarations. Finally we repeat
|
||||
// the missing placeholder declarations but put them in a proper namespace.
|
||||
//
|
||||
// We put the placeholders in boost::placeholders so they can be accessed
|
||||
// explicitly to handle the common case of a "using namespace oost" directive
|
||||
// being in effect.
|
||||
//
|
||||
// Declarations based on boost/bind/placeholders.cpp
|
||||
//
|
||||
namespace boost {
|
||||
namespace placeholders {
|
||||
extern boost::arg<1> _1;
|
||||
extern boost::arg<2> _2;
|
||||
extern boost::arg<3> _3;
|
||||
extern boost::arg<4> _4;
|
||||
extern boost::arg<5> _5;
|
||||
extern boost::arg<6> _6;
|
||||
extern boost::arg<7> _7;
|
||||
extern boost::arg<8> _8;
|
||||
extern boost::arg<9> _9;
|
||||
}
|
||||
using namespace placeholders;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -276,7 +276,7 @@ struct trait_name
|
||||
*/
|
||||
|
||||
#ifndef BEAST_BIND_PLACEHOLDERS_N
|
||||
# if BEAST_MSVC && BEAST_BIND_USES_STD
|
||||
# if BEAST_MSVC && BEAST_FUNCTIONAL_USES_STD
|
||||
# define BEAST_BIND_PLACEHOLDERS_N 20 // Visual Studio 2012
|
||||
# else
|
||||
# define BEAST_BIND_PLACEHOLDERS_N 8 // Seems a reasonable number
|
||||
@@ -297,7 +297,7 @@ struct trait_name
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_BIND_USES_STD
|
||||
#if BEAST_FUNCTIONAL_USES_STD
|
||||
|
||||
namespace functional
|
||||
{
|
||||
@@ -400,7 +400,7 @@ using namespace placeholders;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#elif BEAST_BIND_USES_TR1
|
||||
#elif BEAST_FUNCTIONAL_USES_TR1
|
||||
|
||||
namespace functional
|
||||
{
|
||||
@@ -503,7 +503,7 @@ using namespace placeholders;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#elif BEAST_BIND_USES_BOOST
|
||||
#elif BEAST_FUNCTIONAL_USES_BOOST
|
||||
|
||||
namespace functional
|
||||
{
|
||||
@@ -608,7 +608,7 @@ using namespace placeholders;
|
||||
|
||||
#else
|
||||
|
||||
#error Unknown bind source in beast_Functional.h
|
||||
#error Unknown bind source in Functional.h
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Portions of this file are from JUCE.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
Please visit http://www.juce.com
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
@@ -21,36 +17,36 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CORE_SYSTEM_BINDINCLUDES_H_INCLUDED
|
||||
#define BEAST_CORE_SYSTEM_BINDINCLUDES_H_INCLUDED
|
||||
#ifndef BEAST_CORE_SYSTEM_FUNCTIONALINCLUDES_H_INCLUDED
|
||||
#define BEAST_CORE_SYSTEM_FUNCTIONALINCLUDES_H_INCLUDED
|
||||
|
||||
// Choose a source of bind, placeholders, and function
|
||||
|
||||
#if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST
|
||||
#if !BEAST_FUNCTIONAL_USES_STD && !BEAST_FUNCTIONAL_USES_TR1 && !BEAST_FUNCTIONAL_USES_BOOST
|
||||
# if BEAST_MSVC
|
||||
# define BEAST_BIND_USES_STD 1
|
||||
# define BEAST_FUNCTIONAL_USES_STD 1
|
||||
# elif BEAST_IOS || BEAST_MAC
|
||||
# include <ciso646> // detect version of std::lib
|
||||
# if BEAST_IOS && BEAST_BOOST_IS_AVAILABLE // Work-around for iOS bugs with bind.
|
||||
# define BEAST_BIND_USES_BOOST 1
|
||||
# if BEAST_IOS && BEAST_USE_BOOST_FEATURES // Work-around for iOS bugs with bind.
|
||||
# define BEAST_FUNCTIONAL_USES_BOOST 1
|
||||
# elif _LIBCPP_VERSION // libc++
|
||||
# define BEAST_BIND_USES_STD 1
|
||||
# define BEAST_FUNCTIONAL_USES_STD 1
|
||||
# else // libstdc++ (GNU)
|
||||
# define BEAST_BIND_USES_TR1 1
|
||||
# define BEAST_FUNCTIONAL_USES_TR1 1
|
||||
# endif
|
||||
# elif BEAST_LINUX || BEAST_BSD
|
||||
# define BEAST_BIND_USES_TR1 1
|
||||
# define BEAST_FUNCTIONAL_USES_TR1 1
|
||||
# else
|
||||
# define BEAST_BIND_USES_STD 1
|
||||
# define BEAST_FUNCTIONAL_USES_STD 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BEAST_BIND_USES_STD
|
||||
#if BEAST_FUNCTIONAL_USES_STD
|
||||
# include <functional>
|
||||
#elif BEAST_BIND_USES_TR1
|
||||
#elif BEAST_FUNCTIONAL_USES_TR1
|
||||
# include <tr1/functional>
|
||||
#elif BEAST_BIND_USES_BOOST
|
||||
// included in BoostIncludes.h
|
||||
#elif BEAST_FUNCTIONAL_USES_BOOST
|
||||
// included in BoostPlaceholdersFix.h
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "beast_PlatformDefs.h"
|
||||
#include "PlatformDefs.h"
|
||||
|
||||
// Now we'll include some common OS headers..
|
||||
#if BEAST_MSVC
|
||||
@@ -30,7 +30,7 @@
|
||||
see BeastConfig.h.
|
||||
*/
|
||||
|
||||
#include "../beast_core/system/beast_TargetPlatform.h"
|
||||
#include "../beast_core/system/TargetPlatform.h"
|
||||
|
||||
#if BEAST_IOS || BEAST_MAC
|
||||
# define BEAST_HAVE_NATIVE_SQLITE 1
|
||||
|
||||
Reference in New Issue
Block a user