Change name of boost::align so it doesn't clash with other stuff.

This commit is contained in:
jzmaddock
2014-02-18 13:31:01 +00:00
parent c137710c27
commit 787e28368d

View File

@ -177,7 +177,7 @@ class type_with_alignment
};
#if defined(__GNUC__)
namespace align {
namespace tt_align_ns {
struct __attribute__((__aligned__(2))) a2 {};
struct __attribute__((__aligned__(4))) a4 {};
struct __attribute__((__aligned__(8))) a8 {};
@ -188,22 +188,22 @@ struct __attribute__((__aligned__(128))) a128 {};
}
template<> class type_with_alignment<1> { public: typedef char type; };
template<> class type_with_alignment<2> { public: typedef align::a2 type; };
template<> class type_with_alignment<4> { public: typedef align::a4 type; };
template<> class type_with_alignment<8> { public: typedef align::a8 type; };
template<> class type_with_alignment<16> { public: typedef align::a16 type; };
template<> class type_with_alignment<32> { public: typedef align::a32 type; };
template<> class type_with_alignment<64> { public: typedef align::a64 type; };
template<> class type_with_alignment<128> { public: typedef align::a128 type; };
template<> class type_with_alignment<2> { public: typedef tt_align_ns::a2 type; };
template<> class type_with_alignment<4> { public: typedef tt_align_ns::a4 type; };
template<> class type_with_alignment<8> { public: typedef tt_align_ns::a8 type; };
template<> class type_with_alignment<16> { public: typedef tt_align_ns::a16 type; };
template<> class type_with_alignment<32> { public: typedef tt_align_ns::a32 type; };
template<> class type_with_alignment<64> { public: typedef tt_align_ns::a64 type; };
template<> class type_with_alignment<128> { public: typedef tt_align_ns::a128 type; };
namespace detail {
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a2,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a4,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a16,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a32,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a64,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a128,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true)
}
#endif
#if defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER))
@ -223,7 +223,7 @@ BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a128,true)
// Boost.Optional). However, this only happens when we have no choice
// in the matter because no other "ordinary" type is available.
//
namespace align {
namespace tt_align_ns {
struct __declspec(align(8)) a8 {
char m[8];
typedef a8 type;
@ -251,7 +251,7 @@ template<> class type_with_alignment<8>
{
typedef mpl::if_c<
::boost::alignment_of<boost::detail::max_align>::value < 8,
align::a8,
tt_align_ns::a8,
boost::detail::type_with_alignment_imp<8> >::type t1;
public:
typedef t1::type type;
@ -260,7 +260,7 @@ template<> class type_with_alignment<16>
{
typedef mpl::if_c<
::boost::alignment_of<boost::detail::max_align>::value < 16,
align::a16,
tt_align_ns::a16,
boost::detail::type_with_alignment_imp<16> >::type t1;
public:
typedef t1::type type;
@ -269,7 +269,7 @@ template<> class type_with_alignment<32>
{
typedef mpl::if_c<
::boost::alignment_of<boost::detail::max_align>::value < 32,
align::a32,
tt_align_ns::a32,
boost::detail::type_with_alignment_imp<32> >::type t1;
public:
typedef t1::type type;
@ -277,7 +277,7 @@ public:
template<> class type_with_alignment<64> {
typedef mpl::if_c<
::boost::alignment_of<boost::detail::max_align>::value < 64,
align::a64,
tt_align_ns::a64,
boost::detail::type_with_alignment_imp<64> >::type t1;
public:
typedef t1::type type;
@ -285,18 +285,18 @@ public:
template<> class type_with_alignment<128> {
typedef mpl::if_c<
::boost::alignment_of<boost::detail::max_align>::value < 128,
align::a128,
tt_align_ns::a128,
boost::detail::type_with_alignment_imp<128> >::type t1;
public:
typedef t1::type type;
};
namespace detail {
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a16,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a32,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a64,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a128,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true)
}
#endif
@ -308,7 +308,7 @@ BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a128,true)
// 2) Because of Borlands #pragma option we can create types with alignments that are
// greater that the largest aligned builtin type.
namespace align{
namespace tt_align_ns{
#pragma option push -a16
struct a2{ short s; };
struct a4{ int s; };
@ -319,13 +319,13 @@ struct a16{ long double s; };
namespace detail {
typedef ::boost::align::a16 max_align;
typedef ::boost::tt_align_ns::a16 max_align;
//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a2,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a4,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a16,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true)
//#endif
}
@ -334,13 +334,13 @@ template <std::size_t N> struct type_with_alignment
// We should never get to here, but if we do use the maximally
// aligned type:
// BOOST_STATIC_ASSERT(0);
typedef align::a16 type;
typedef tt_align_ns::a16 type;
};
template <> struct type_with_alignment<1>{ typedef char type; };
template <> struct type_with_alignment<2>{ typedef align::a2 type; };
template <> struct type_with_alignment<4>{ typedef align::a4 type; };
template <> struct type_with_alignment<8>{ typedef align::a8 type; };
template <> struct type_with_alignment<16>{ typedef align::a16 type; };
template <> struct type_with_alignment<2>{ typedef tt_align_ns::a2 type; };
template <> struct type_with_alignment<4>{ typedef tt_align_ns::a4 type; };
template <> struct type_with_alignment<8>{ typedef tt_align_ns::a8 type; };
template <> struct type_with_alignment<16>{ typedef tt_align_ns::a16 type; };
#endif