From 085f2e06204d6b2710db127806cfa855fca17d79 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Thu, 15 Mar 2012 17:23:56 -0400 Subject: [PATCH] Fix FTBFS with Boost 1.49.0 The implementation of BOOST_PP_ITERATION_FLAGS() changed in Boost 1.49.0, which causes Luabind to fail to build with GCC (reproduced with GCC 4.4 and GCC 4.6). https://svn.boost.org/trac/boost/ticket/6631 http://thread.gmane.org/gmane.comp.lib.boost.devel/228802 http://article.gmane.org/gmane.comp.lib.boost.devel/228836 The work-around is to replace the pattern #if !defined(MACRO) // A #elif MACRO() // B #endif with #if !defined(MACRO) // A #else #if MACRO() // B #endif #endif --- luabind/detail/call_function.hpp | 4 +++- luabind/detail/call_member.hpp | 4 +++- luabind/wrapper_base.hpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/luabind/detail/call_function.hpp b/luabind/detail/call_function.hpp index eea1ccfb..befc629d 100644 --- a/luabind/detail/call_function.hpp +++ b/luabind/detail/call_function.hpp @@ -317,7 +317,8 @@ namespace luabind #endif // LUABIND_CALL_FUNCTION_HPP_INCLUDED -#elif BOOST_PP_ITERATION_FLAGS() == 1 +#else +#if BOOST_PP_ITERATION_FLAGS() == 1 #define LUABIND_TUPLE_PARAMS(z, n, data) const A##n * #define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n @@ -432,4 +433,5 @@ namespace luabind #endif +#endif diff --git a/luabind/detail/call_member.hpp b/luabind/detail/call_member.hpp index 7fdbd501..67735ff4 100644 --- a/luabind/detail/call_member.hpp +++ b/luabind/detail/call_member.hpp @@ -312,7 +312,8 @@ namespace luabind #endif // LUABIND_CALL_MEMBER_HPP_INCLUDED -#elif BOOST_PP_ITERATION_FLAGS() == 1 +#else +#if BOOST_PP_ITERATION_FLAGS() == 1 #define LUABIND_TUPLE_PARAMS(z, n, data) const A##n * #define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n @@ -356,4 +357,5 @@ namespace luabind #undef LUABIND_TUPLE_PARAMS #endif +#endif diff --git a/luabind/wrapper_base.hpp b/luabind/wrapper_base.hpp index d54c668f..0f88cc5c 100755 --- a/luabind/wrapper_base.hpp +++ b/luabind/wrapper_base.hpp @@ -89,7 +89,8 @@ namespace luabind #endif // LUABIND_WRAPPER_BASE_HPP_INCLUDED -#elif BOOST_PP_ITERATION_FLAGS() == 1 +#else +#if BOOST_PP_ITERATION_FLAGS() == 1 #define LUABIND_TUPLE_PARAMS(z, n, data) const A##n * #define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n @@ -188,3 +189,4 @@ namespace luabind #undef N #endif +#endif