From 38516ef79396666755b6291cb2d4b338647f1e76 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 25 Aug 2013 02:26:49 -0700 Subject: [PATCH] Tidy up beast project files --- Builds/VisualStudio2012/beast.vcxproj | 14 +++--- Builds/VisualStudio2012/beast.vcxproj.filters | 36 +++++++------- modules/beast_asio/beast_asio.h | 2 +- .../beast_asio/sockets/beast_SocketWrapper.h | 2 +- ...{beast_BoostIncludes.h => BoostIncludes.h} | 48 ++----------------- .../diagnostic/beast_LeakChecked.cpp | 4 ++ modules/beast_core/system/BindIncludes.h | 3 +- modules/beast_core/system/BoostIncludes.h | 41 ++++++++++------ .../beast_extras.cpp} | 2 +- .../beast_extras.h} | 4 +- .../traits/beast_BoostLockableTraits.h | 0 11 files changed, 66 insertions(+), 90 deletions(-) rename modules/beast_asio/system/{beast_BoostIncludes.h => BoostIncludes.h} (67%) rename modules/{beast_boost/beast_boost.cpp => beast_extras/beast_extras.cpp} (97%) rename modules/{beast_boost/beast_boost.h => beast_extras/beast_extras.h} (95%) rename modules/{beast_boost => beast_extras}/traits/beast_BoostLockableTraits.h (100%) diff --git a/Builds/VisualStudio2012/beast.vcxproj b/Builds/VisualStudio2012/beast.vcxproj index e066b66e..07a2ab45 100644 --- a/Builds/VisualStudio2012/beast.vcxproj +++ b/Builds/VisualStudio2012/beast.vcxproj @@ -90,7 +90,7 @@ - + @@ -104,8 +104,6 @@ - - @@ -295,6 +293,8 @@ + + @@ -416,7 +416,6 @@ true true - true @@ -1150,6 +1149,7 @@ true true + true @@ -1306,7 +1306,7 @@ Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir) + $(ProjectDir);%(AdditionalIncludeDirectories) Windows @@ -1321,7 +1321,7 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir) + $(ProjectDir);%(AdditionalIncludeDirectories) Windows @@ -1338,7 +1338,7 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir) + $(ProjectDir);%(AdditionalIncludeDirectories) Windows diff --git a/Builds/VisualStudio2012/beast.vcxproj.filters b/Builds/VisualStudio2012/beast.vcxproj.filters index b0ca0d76..c8800430 100644 --- a/Builds/VisualStudio2012/beast.vcxproj.filters +++ b/Builds/VisualStudio2012/beast.vcxproj.filters @@ -143,12 +143,6 @@ {beb81776-4aad-401d-8826-81478dbbf30b} - - {0eac8b8d-7049-4eda-b6b4-53194d336a97} - - - {1e6959ed-fcb9-4a3b-ac5a-eb26973e21f6} - {493db217-b3e4-4b08-97b2-a2d753cc8c35} @@ -161,6 +155,12 @@ {5df65855-1ccd-4997-97c1-f9788924ee2b} + + {2f5b95a8-1adf-4319-8464-ddc2b2e03f0b} + + + {bf498396-2e1f-4903-be68-3053ba439af5} + @@ -695,9 +695,6 @@ beast_asio\sockets - - beast_asio\system - beast_asio\tests @@ -794,18 +791,12 @@ beast_core\diagnostic - - beast_boost - beast_core\threads beast_core\threads - - beast_boost\traits - beast_core\thread @@ -911,6 +902,15 @@ beast_asio + + beast_asio\system + + + beast_extras\traits + + + beast_extras + @@ -1327,9 +1327,6 @@ beast_asio\async - - beast_boost - beast_core\threads @@ -1387,6 +1384,9 @@ beast_asio\basics + + beast_extras + diff --git a/modules/beast_asio/beast_asio.h b/modules/beast_asio/beast_asio.h index f858ab96..66cd28ab 100644 --- a/modules/beast_asio/beast_asio.h +++ b/modules/beast_asio/beast_asio.h @@ -41,7 +41,7 @@ #include "../beast_core/beast_core.h" // This module requires boost and possibly OpenSSL -#include "system/beast_BoostIncludes.h" +#include "system/BoostIncludes.h" // Checking overrides replaces unimplemented stubs with pure virtuals #ifndef BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES diff --git a/modules/beast_asio/sockets/beast_SocketWrapper.h b/modules/beast_asio/sockets/beast_SocketWrapper.h index b7e86ab0..ea2f6716 100644 --- a/modules/beast_asio/sockets/beast_SocketWrapper.h +++ b/modules/beast_asio/sockets/beast_SocketWrapper.h @@ -190,7 +190,7 @@ public: // // This include will be needed: // - // #include + // boost/tti/has_type.hpp // // BOOST_TTI_HAS_TYPE(native_handle_type) diff --git a/modules/beast_asio/system/beast_BoostIncludes.h b/modules/beast_asio/system/BoostIncludes.h similarity index 67% rename from modules/beast_asio/system/beast_BoostIncludes.h rename to modules/beast_asio/system/BoostIncludes.h index 72cad3b0..7f797024 100644 --- a/modules/beast_asio/system/beast_BoostIncludes.h +++ b/modules/beast_asio/system/BoostIncludes.h @@ -38,8 +38,11 @@ # endif #endif -#include +// Unfortunately, we use some boost detail elements +// +// https://svn.boost.org/trac/boost/ticket/9024 +#include #include #include #include @@ -47,29 +50,9 @@ #include #include #include - -// Unfortunately, we need to use some boost detail -// -// https://svn.boost.org/trac/boost/ticket/9024 -// #include #include -// Not sure when handler_type was added but it's not in 1.48 -#ifndef BEAST_ASIO_HAS_HANDLER_TYPE -# if BOOST_VERSION >= 105400 -# define BEAST_ASIO_HAS_HANDLER_TYPE 1 -# else -# define BEAST_ASIO_HAS_HANDLER_TYPE 0 -# endif -#endif -#if BEAST_ASIO_HAS_HANDLER_TYPE -# include -# define BEAST_ASIO_HANDLER_TYPE(h, sig) BOOST_ASIO_HANDLER_TYPE(h, sig) -#else -# define BEAST_ASIO_HANDLER_TYPE(h, sig) h -#endif - // Continuation hooks added in 1.54.0 #ifndef BEAST_ASIO_HAS_CONTINUATION_HOOKS # if BOOST_VERSION >= 105400 @@ -89,33 +72,10 @@ # ifndef BEAST_ASIO_HAS_BUFFEREDHANDSHAKE # define BEAST_ASIO_HAS_BUFFEREDHANDSHAKE 1 # endif -# ifndef BEAST_ASIO_HAS_FUTURE_RETURNS -# define BEAST_ASIO_HAS_FUTURE_RETURNS 1 -# endif #else # ifndef BEAST_ASIO_HAS_BUFFEREDHANDSHAKE # define BEAST_ASIO_HAS_BUFFEREDHANDSHAKE 0 # endif -# ifndef BEAST_ASIO_HAS_FUTURE_RETURNS -# define BEAST_ASIO_HAS_FUTURE_RETURNS 0 -# endif -#endif - -#if ! BEAST_ASIO_HAS_FUTURE_RETURNS -# define BEAST_ASIO_INITFN_RESULT_TYPE(expr,val) void -# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(expr,val) void -#else -# define BEAST_ASIO_INITFN_RESULT_TYPE(expr,val) BOOST_ASIO_INITFN_RESULT_TYPE(expr,val) -# if defined(GENERATING_DOCUMENTATION) -# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(h, sig) \ - void_or_deduced -# elif defined(_MSC_VER) && (_MSC_VER < 1500) -# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(h, sig) \ - boost::asio::detail::async_result_type_helper::type -# else -# define BEAST_ASIO_INITFN_RESULT_TYPE_MEMBER(h, sig) \ - boost::asio::async_result ::type>::type -# endif #endif #endif diff --git a/modules/beast_core/diagnostic/beast_LeakChecked.cpp b/modules/beast_core/diagnostic/beast_LeakChecked.cpp index 5173b047..b70e4169 100644 --- a/modules/beast_core/diagnostic/beast_LeakChecked.cpp +++ b/modules/beast_core/diagnostic/beast_LeakChecked.cpp @@ -89,7 +89,11 @@ void LeakCheckedBase::CounterBase::checkForLeaks () //------------------------------------------------------------------------------ +#if BEAST_DEBUG void LeakCheckedBase::reportDanglingPointer (char const* objectName) +#else +void LeakCheckedBase::reportDanglingPointer (char const*) +#endif { /* If you hit this, then you've managed to delete more instances of this class than you've created. That indicates that you're diff --git a/modules/beast_core/system/BindIncludes.h b/modules/beast_core/system/BindIncludes.h index 1782ad2e..0eb1504e 100644 --- a/modules/beast_core/system/BindIncludes.h +++ b/modules/beast_core/system/BindIncludes.h @@ -50,8 +50,7 @@ #elif BEAST_BIND_USES_TR1 # include #elif BEAST_BIND_USES_BOOST -# include -# include +// included in BoostIncludes.h #endif #endif diff --git a/modules/beast_core/system/BoostIncludes.h b/modules/beast_core/system/BoostIncludes.h index f25557b5..fcd1ceaf 100644 --- a/modules/beast_core/system/BoostIncludes.h +++ b/modules/beast_core/system/BoostIncludes.h @@ -31,27 +31,39 @@ #endif //------------------------------------------------------------------------------ + #if BEAST_BOOST_IS_AVAILABLE +// Prevent 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 +#include +#include +#include +#include // for FifoFreeStoreWithTLS #include + #if BOOST_VERSION > 105499 # error "This hasnt been tested with boost versions above 1.54" #endif -// Used for FifoFreeStoreWithTLS -#include - -// This is a hack to fix boost's goofy placeholders -#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED -#error must not be included before this file -#endif - -// Prevent from being included -#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED -#include -#include - -// This based on +// 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; @@ -68,6 +80,7 @@ using namespace placeholders; } #endif + //------------------------------------------------------------------------------ #endif diff --git a/modules/beast_boost/beast_boost.cpp b/modules/beast_extras/beast_extras.cpp similarity index 97% rename from modules/beast_boost/beast_boost.cpp rename to modules/beast_extras/beast_extras.cpp index 7a58ced0..2813fee7 100644 --- a/modules/beast_boost/beast_boost.cpp +++ b/modules/beast_extras/beast_extras.cpp @@ -19,7 +19,7 @@ #include "BeastConfig.h" -#include "beast_boost.h" +#include "beast_extras.h" namespace beast { diff --git a/modules/beast_boost/beast_boost.h b/modules/beast_extras/beast_extras.h similarity index 95% rename from modules/beast_boost/beast_boost.h rename to modules/beast_extras/beast_extras.h index 6e49a8a3..b9df7bf4 100644 --- a/modules/beast_boost/beast_boost.h +++ b/modules/beast_extras/beast_extras.h @@ -17,8 +17,8 @@ */ //============================================================================== -#ifndef BEAST_BOOST_H_INCLUDED -#define BEAST_BOOST_H_INCLUDED +#ifndef BEAST_EXTRAS_H_INCLUDED +#define BEAST_EXTRAS_H_INCLUDED // Adds boost-specific features to beast. diff --git a/modules/beast_boost/traits/beast_BoostLockableTraits.h b/modules/beast_extras/traits/beast_BoostLockableTraits.h similarity index 100% rename from modules/beast_boost/traits/beast_BoostLockableTraits.h rename to modules/beast_extras/traits/beast_BoostLockableTraits.h