From ab57495e29d6ab6209bc50c9ca77b512780bf1c9 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 28 Jun 2013 10:19:40 -0700 Subject: [PATCH] Hack to put boost placeholders in a namespace --- modules/beast_basics/beast_basics.h | 57 +++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/modules/beast_basics/beast_basics.h b/modules/beast_basics/beast_basics.h index 1fd550f3f5..e7226faa19 100644 --- a/modules/beast_basics/beast_basics.h +++ b/modules/beast_basics/beast_basics.h @@ -222,12 +222,12 @@ @todo Discuss the treatment of exceptions versus Error objects in the library. - @todo Discuss the additions to AppConfig.h + @todo Discuss the additions to BeastConfig.h @defgroup beast_core beast_core */ -/* See the Juce notes regarding AppConfig.h +/* See the JUCE notes regarding BeastConfig.h This file must always be included before any Juce headers. @@ -238,7 +238,7 @@ /* BeastConfig.h must be included before this file */ /* Use sensible default configurations if they forgot - to append the necessary macros into their AppConfig.h. + to append the necessary macros into their BeastConfig.h. */ #ifndef BEAST_USE_BOOST #define BEAST_USE_BOOST 0 @@ -286,6 +286,57 @@ //------------------------------------------------------------------------------ +// This is a hack to fix boost's goofy placeholders +#if BEAST_USE_BOOST +#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 is from +namespace boost { +namespace placeholders { +#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4) +static inline boost::arg<1> _1() { return boost::arg<1>(); } +static inline boost::arg<2> _2() { return boost::arg<2>(); } +static inline boost::arg<3> _3() { return boost::arg<3>(); } +static inline boost::arg<4> _4() { return boost::arg<4>(); } +static inline boost::arg<5> _5() { return boost::arg<5>(); } +static inline boost::arg<6> _6() { return boost::arg<6>(); } +static inline boost::arg<7> _7() { return boost::arg<7>(); } +static inline boost::arg<8> _8() { return boost::arg<8>(); } +static inline boost::arg<9> _9() { return boost::arg<9>(); } +#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__) || \ + defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 2) +static boost::arg<1> _1; +static boost::arg<2> _2; +static boost::arg<3> _3; +static boost::arg<4> _4; +static boost::arg<5> _5; +static boost::arg<6> _6; +static boost::arg<7> _7; +static boost::arg<8> _8; +static boost::arg<9> _9; +#else +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 +} +using namespace placeholders; +} +#endif + +//------------------------------------------------------------------------------ + // Choose a source of bind, placeholders, and function #if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST