Boost Patch for Build with GCC 4.6

Late GCC versions implemented active evaluation which evaluates some code in older boost libraries those are never evaluated. Thus it causes errors. The patch below shows an example of fixing them for spirit 1.8.5.

boost 1.34.1 diff for building with g++ 4.6.3

diff -aur boost_1_34_1_orig/boost/mpl/apply.hpp boost_1_34_1/boost/mpl/apply.hpp
--- boost_1_34_1_orig/boost/mpl/apply.hpp       2004-09-02 08:40:41.000000000 -0700
+++ boost_1_34_1/boost/mpl/apply.hpp    2012-07-25 00:14:31.356287372 -0700
@@ -135,7 +135,8 @@

 ///// iteration, depth == 1

-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1

 #   define i_ BOOST_PP_FRAME_ITERATION(1)

@@ -222,4 +223,5 @@

 #   undef i_

+#endif
 #endif // BOOST_PP_IS_ITERATING
diff -aur boost_1_34_1_orig/boost/mpl/apply_wrap.hpp boost_1_34_1/boost/mpl/apply_wrap.hpp
--- boost_1_34_1_orig/boost/mpl/apply_wrap.hpp  2004-09-03 08:56:55.000000000 -0700
+++ boost_1_34_1/boost/mpl/apply_wrap.hpp       2012-07-25 00:13:13.734259371 -0700
@@ -78,7 +78,8 @@

 ///// iteration, depth == 1

-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1

 #   define i_ BOOST_PP_FRAME_ITERATION(1)

@@ -170,7 +171,8 @@

 ///// iteration, depth == 2

-#elif BOOST_PP_ITERATION_DEPTH() == 2
+#else 
+#if BOOST_PP_ITERATION_DEPTH() == 2

 #   define j_ BOOST_PP_FRAME_ITERATION(2)

@@ -197,4 +199,6 @@

 #   undef j_

+#endif
+#endif
 #endif // BOOST_PP_IS_ITERATING
diff -aur boost_1_34_1_orig/boost/mpl/aux_/advance_backward.hpp boost_1_34_1/boost/mpl/aux_/advance_backward.hpp
--- boost_1_34_1_orig/boost/mpl/aux_/advance_backward.hpp       2004-09-02 08:40:43.000000000 -0700
+++ boost_1_34_1/boost/mpl/aux_/advance_backward.hpp    2012-07-25 00:19:06.265850825 -0700
@@ -79,7 +79,8 @@

 ///// iteration, depth == 1

-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1
 #define i_ BOOST_PP_FRAME_ITERATION(1)

 template<>
@@ -111,7 +112,8 @@

 ///// iteration, depth == 2

-#elif BOOST_PP_ITERATION_DEPTH() == 2
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 2

 #   define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
 #   define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
@@ -121,4 +123,6 @@
 #   undef AUX778076_ITER_1
 #   undef AUX778076_ITER_0

+#endif
+#endif
 #endif // BOOST_PP_IS_ITERATING
diff -aur boost_1_34_1_orig/boost/mpl/aux_/advance_forward.hpp boost_1_34_1/boost/mpl/aux_/advance_forward.hpp
--- boost_1_34_1_orig/boost/mpl/aux_/advance_forward.hpp        2004-09-02 08:40:43.000000000 -0700
+++ boost_1_34_1/boost/mpl/aux_/advance_forward.hpp     2012-07-25 00:19:17.151714383 -0700
@@ -79,7 +79,8 @@

 ///// iteration, depth == 1

-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1
 #define i_ BOOST_PP_FRAME_ITERATION(1)

 template<>
@@ -110,7 +111,8 @@

 ///// iteration, depth == 2

-#elif BOOST_PP_ITERATION_DEPTH() == 2
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 2

 #   define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
 #   define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
@@ -120,4 +122,6 @@
 #   undef AUX778076_ITER_1
 #   undef AUX778076_ITER_0

+#endif
+#endif
 #endif // BOOST_PP_IS_ITERATING
diff -aur boost_1_34_1_orig/boost/mpl/aux_/full_lambda.hpp boost_1_34_1/boost/mpl/aux_/full_lambda.hpp
--- boost_1_34_1_orig/boost/mpl/aux_/full_lambda.hpp    2004-09-03 18:10:19.000000000 -0700
+++ boost_1_34_1/boost/mpl/aux_/full_lambda.hpp 2012-07-25 00:17:13.729257429 -0700
@@ -227,7 +227,8 @@

 ///// iteration, depth == 1

-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1
 #define i_ BOOST_PP_FRAME_ITERATION(1)

 #if i_ > 0
@@ -347,4 +348,5 @@
 };

 #undef i_
+#endif
 #endif // BOOST_PP_IS_ITERATING
diff -aur boost_1_34_1_orig/boost/mpl/aux_/numeric_op.hpp boost_1_34_1/boost/mpl/aux_/numeric_op.hpp
--- boost_1_34_1_orig/boost/mpl/aux_/numeric_op.hpp     2005-08-25 09:27:21.000000000 -0700
+++ boost_1_34_1/boost/mpl/aux_/numeric_op.hpp  2012-07-25 00:17:42.896892737 -0700
@@ -287,7 +287,8 @@

 ///// iteration, depth == 1

-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1

 #   define i_ BOOST_PP_FRAME_ITERATION(1)
 
@@ -308,4 +309,5 @@
 
 #   undef i_
 
+#endif
 #endif // BOOST_PP_IS_ITERATING
diff -aur boost_1_34_1_orig/boost/mpl/bind.hpp boost_1_34_1/boost/mpl/bind.hpp
--- boost_1_34_1_orig/boost/mpl/bind.hpp        2004-10-26 07:51:04.000000000 -0700
+++ boost_1_34_1/boost/mpl/bind.hpp     2012-07-25 00:16:00.200178347 -0700
@@ -361,7 +361,8 @@
 
 ///// iteration, depth == 1
 
-#elif BOOST_PP_ITERATION_DEPTH() == 1
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 1
 
 #   define i_ BOOST_PP_FRAME_ITERATION(1)
 
@@ -528,7 +529,8 @@
 
 ///// iteration, depth == 2
 
-#elif BOOST_PP_ITERATION_DEPTH() == 2
+#else
+#if BOOST_PP_ITERATION_DEPTH() == 2
 
 #   define j_ BOOST_PP_FRAME_ITERATION(2)
 #   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
@@ -544,4 +546,6 @@
 #   endif
 #   undef j_
 
+#endif
+#endif
 #endif // BOOST_PP_IS_ITERATING

Advertisements

About minghuasweblog

a long time coder
This entry was posted in All, C/C++ and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s