diff -urb -x .svn -x string.o trunk/boost/mpl/string.hpp trunk_patched/boost/mpl/string.hpp --- trunk/boost/mpl/string.hpp 2009-04-24 17:51:11.000000000 +0400 +++ trunk_patched/boost/mpl/string.hpp 2009-04-24 17:51:01.000000000 +0400 @@ -43,6 +43,7 @@ #include #include #include +#include namespace boost { namespace mpl { @@ -51,9 +52,26 @@ // Low-level bit-twiddling is done by macros. Any implementation-defined behavior of // multi-character literals should be localized to these macros. + #define BOOST_MPL_MULTICHAR_LENGTH(c) \ (std::size_t)((c>0xffffff)+(c>0xffff)+(c>0xff)+1) + #if defined(BOOST_LITTLE_ENDIAN) && BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) + #define BOOST_MPL_MULTICHAR_AT(c,i) \ + (char)(0xff&(c>>(8*(std::size_t)(i)))) + + #define BOOST_MPL_MULTICHAR_PUSH_BACK(c,i) \ + ((((unsigned char)(i))<<(BOOST_MPL_MULTICHAR_LENGTH(c)*8))|(c)) + + #define BOOST_MPL_MULTICHAR_PUSH_FRONT(c,i) \ + (((c)<<8)|(unsigned char)(i)) + + #define BOOST_MPL_MULTICHAR_POP_BACK(c) \ + (((1<<((BOOST_MPL_MULTICHAR_LENGTH(c)-1)*8))-1)&(c)) + + #define BOOST_MPL_MULTICHAR_POP_FRONT(c) \ + ((c)>>8) + #else #define BOOST_MPL_MULTICHAR_AT(c,i) \ (char)(0xff&(c>>(8*(BOOST_MPL_MULTICHAR_LENGTH(c)-(std::size_t)(i)-1)))) @@ -68,6 +86,7 @@ #define BOOST_MPL_MULTICHAR_POP_FRONT(c) \ (((1<<((BOOST_MPL_MULTICHAR_LENGTH(c)-1)*8))-1)&(c)) + #endif struct string_tag; struct string_iterator_tag;