ndnboost: Also rename BOOST_ to NDNBOOST_
diff --git a/include/ndnboost/function/function_base.hpp b/include/ndnboost/function/function_base.hpp
index 30af1a3..f992eb3 100644
--- a/include/ndnboost/function/function_base.hpp
+++ b/include/ndnboost/function/function_base.hpp
@@ -8,8 +8,8 @@
// For more information, see http://www.boost.org
-#ifndef BOOST_FUNCTION_BASE_HEADER
-#define BOOST_FUNCTION_BASE_HEADER
+#ifndef NDNBOOST_FUNCTION_BASE_HEADER
+#define NDNBOOST_FUNCTION_BASE_HEADER
#include <stdexcept>
#include <string>
@@ -30,7 +30,7 @@
#include <ndnboost/mpl/if.hpp>
#include <ndnboost/detail/workaround.hpp>
#include <ndnboost/type_traits/alignment_of.hpp>
-#ifndef BOOST_NO_SFINAE
+#ifndef NDNBOOST_NO_SFINAE
# include "ndnboost/utility/enable_if.hpp"
#else
# include "ndnboost/mpl/bool.hpp"
@@ -38,49 +38,49 @@
#include <ndnboost/function_equal.hpp>
#include <ndnboost/function/function_fwd.hpp>
-#if defined(BOOST_MSVC)
+#if defined(NDNBOOST_MSVC)
# pragma warning( push )
# pragma warning( disable : 4793 ) // complaint about native code generation
# pragma warning( disable : 4127 ) // "conditional expression is constant"
#endif
-// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
-#ifdef BOOST_NO_STD_TYPEINFO
+// Define NDNBOOST_FUNCTION_STD_NS to the namespace that contains type_info.
+#ifdef NDNBOOST_NO_STD_TYPEINFO
// Embedded VC++ does not have type_info in namespace std
-# define BOOST_FUNCTION_STD_NS
+# define NDNBOOST_FUNCTION_STD_NS
#else
-# define BOOST_FUNCTION_STD_NS std
+# define NDNBOOST_FUNCTION_STD_NS std
#endif
// Borrowed from Boost.Python library: determines the cases where we
// need to use std::type_info::name to compare instead of operator==.
-#if defined( BOOST_NO_TYPEID )
-# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
+#if defined( NDNBOOST_NO_TYPEID )
+# define NDNBOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
#elif (defined(__GNUC__) && __GNUC__ >= 3) \
|| defined(_AIX) \
|| ( defined(__sgi) && defined(__host_mips))
# include <cstring>
-# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \
+# define NDNBOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \
(std::strcmp((X).name(),(Y).name()) == 0)
# else
-# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
+# define NDNBOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
#endif
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
-# define BOOST_FUNCTION_TARGET_FIX(x) x
+#if defined(NDNBOOST_MSVC) && NDNBOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(NDNBOOST_STRICT_CONFIG)
+# define NDNBOOST_FUNCTION_TARGET_FIX(x) x
#else
-# define BOOST_FUNCTION_TARGET_FIX(x)
+# define NDNBOOST_FUNCTION_TARGET_FIX(x)
#endif // not MSVC
-#if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0)
-# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
+#if !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x5A0)
+# define NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
typename ::ndnboost::enable_if_c<(::ndnboost::type_traits::ice_not< \
(::ndnboost::is_integral<Functor>::value)>::value), \
Type>::type
#else
// BCC doesn't recognize this depends on a template argument and complains
// about the use of 'typename'
-# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
+# define NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
::ndnboost::enable_if_c<(::ndnboost::type_traits::ice_not< \
(::ndnboost::is_integral<Functor>::value)>::value), \
Type>::type
@@ -222,7 +222,7 @@
// Check whether we have the same type. We can add
// cv-qualifiers, but we can't take them away.
- if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(F))
+ if (NDNBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, NDNBOOST_SP_TYPEID(F))
&& (!in_buffer.obj_ref.is_const_qualified
|| out_buffer.type.const_qualified)
&& (!in_buffer.obj_ref.is_volatile_qualified
@@ -234,7 +234,7 @@
return;
case get_functor_type_tag:
- out_buffer.type.type = &BOOST_SP_TYPEID(F);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(F);
out_buffer.type.const_qualified = in_buffer.obj_ref.is_const_qualified;
out_buffer.type.volatile_qualified = in_buffer.obj_ref.is_volatile_qualified;
return;
@@ -249,7 +249,7 @@
template<typename F>
struct function_allows_small_object_optimization
{
- BOOST_STATIC_CONSTANT
+ NDNBOOST_STATIC_CONSTANT
(bool,
value = ((sizeof(F) <= sizeof(function_buffer) &&
(alignment_of<function_buffer>::value
@@ -296,12 +296,12 @@
else if (op == check_functor_type_tag) {
const detail::sp_typeinfo& check_type
= *out_buffer.type.type;
- if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor)))
+ if (NDNBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, NDNBOOST_SP_TYPEID(Functor)))
out_buffer.obj_ptr = &in_buffer.func_ptr;
else
out_buffer.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
- out_buffer.type.type = &BOOST_SP_TYPEID(Functor);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(Functor);
out_buffer.type.const_qualified = false;
out_buffer.type.volatile_qualified = false;
}
@@ -330,12 +330,12 @@
} else if (op == check_functor_type_tag) {
const detail::sp_typeinfo& check_type
= *out_buffer.type.type;
- if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor)))
+ if (NDNBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, NDNBOOST_SP_TYPEID(Functor)))
out_buffer.obj_ptr = &in_buffer.data;
else
out_buffer.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
- out_buffer.type.type = &BOOST_SP_TYPEID(Functor);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(Functor);
out_buffer.type.const_qualified = false;
out_buffer.type.volatile_qualified = false;
}
@@ -391,12 +391,12 @@
} else if (op == check_functor_type_tag) {
const detail::sp_typeinfo& check_type
= *out_buffer.type.type;
- if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor)))
+ if (NDNBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, NDNBOOST_SP_TYPEID(Functor)))
out_buffer.obj_ptr = in_buffer.obj_ptr;
else
out_buffer.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
- out_buffer.type.type = &BOOST_SP_TYPEID(Functor);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(Functor);
out_buffer.type.const_qualified = false;
out_buffer.type.volatile_qualified = false;
}
@@ -431,7 +431,7 @@
typedef typename get_function_tag<functor_type>::type tag_type;
switch (op) {
case get_functor_type_tag:
- out_buffer.type.type = &BOOST_SP_TYPEID(functor_type);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(functor_type);
out_buffer.type.const_qualified = false;
out_buffer.type.volatile_qualified = false;
return;
@@ -502,12 +502,12 @@
} else if (op == check_functor_type_tag) {
const detail::sp_typeinfo& check_type
= *out_buffer.type.type;
- if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor)))
+ if (NDNBOOST_FUNCTION_COMPARE_TYPE_ID(check_type, NDNBOOST_SP_TYPEID(Functor)))
out_buffer.obj_ptr = in_buffer.obj_ptr;
else
out_buffer.obj_ptr = 0;
} else /* op == get_functor_type_tag */ {
- out_buffer.type.type = &BOOST_SP_TYPEID(Functor);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(Functor);
out_buffer.type.const_qualified = false;
out_buffer.type.volatile_qualified = false;
}
@@ -534,7 +534,7 @@
typedef typename get_function_tag<functor_type>::type tag_type;
switch (op) {
case get_functor_type_tag:
- out_buffer.type.type = &BOOST_SP_TYPEID(functor_type);
+ out_buffer.type.type = &NDNBOOST_SP_TYPEID(functor_type);
out_buffer.type.const_qualified = false;
out_buffer.type.volatile_qualified = false;
return;
@@ -549,7 +549,7 @@
// A type that is only used for comparisons against zero
struct useless_clear_type {};
-#ifdef BOOST_NO_SFINAE
+#ifdef NDNBOOST_NO_SFINAE
// These routines perform comparisons between a Boost.Function
// object and an arbitrary function object (when the last
// parameter is mpl::bool_<false>) or against zero (when the
@@ -606,7 +606,7 @@
return fp != g.get_pointer();
else return true;
}
-#endif // BOOST_NO_SFINAE
+#endif // NDNBOOST_NO_SFINAE
/**
* Stores the "manager" portion of the vtable for a
@@ -635,11 +635,11 @@
/** Determine if the function is empty (i.e., has no target). */
bool empty() const { return !vtable; }
- /** Retrieve the type of the stored function object, or BOOST_SP_TYPEID(void)
+ /** Retrieve the type of the stored function object, or NDNBOOST_SP_TYPEID(void)
if this is empty. */
const detail::sp_typeinfo& target_type() const
{
- if (!vtable) return BOOST_SP_TYPEID(void);
+ if (!vtable) return NDNBOOST_SP_TYPEID(void);
detail::function::function_buffer type;
get_vtable()->manager(functor, type, detail::function::get_functor_type_tag);
@@ -652,7 +652,7 @@
if (!vtable) return 0;
detail::function::function_buffer type_result;
- type_result.type.type = &BOOST_SP_TYPEID(Functor);
+ type_result.type.type = &NDNBOOST_SP_TYPEID(Functor);
type_result.type.const_qualified = is_const<Functor>::value;
type_result.type.volatile_qualified = is_volatile<Functor>::value;
get_vtable()->manager(functor, type_result,
@@ -661,7 +661,7 @@
}
template<typename Functor>
-#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+#if defined(NDNBOOST_MSVC) && NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
const Functor* target( Functor * = 0 ) const
#else
const Functor* target() const
@@ -670,7 +670,7 @@
if (!vtable) return 0;
detail::function::function_buffer type_result;
- type_result.type.type = &BOOST_SP_TYPEID(Functor);
+ type_result.type.type = &NDNBOOST_SP_TYPEID(Functor);
type_result.type.const_qualified = true;
type_result.type.volatile_qualified = is_volatile<Functor>::value;
get_vtable()->manager(functor, type_result,
@@ -683,7 +683,7 @@
template<typename F>
bool contains(const F& f) const
{
-#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+#if defined(NDNBOOST_MSVC) && NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
if (const F* fp = this->target( (F*)0 ))
#else
if (const F* fp = this->template target<F>())
@@ -700,7 +700,7 @@
// problems with instantiation of function return types before it
// has been verified that the argument types match up.
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator==(Functor g) const
{
if (const Functor* fp = target<Functor>())
@@ -709,7 +709,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator!=(Functor g) const
{
if (const Functor* fp = target<Functor>())
@@ -742,7 +742,7 @@
bad_function_call() : std::runtime_error("call to empty ndnboost::function") {}
};
-#ifndef BOOST_NO_SFINAE
+#ifndef NDNBOOST_NO_SFINAE
inline bool operator==(const function_base& f,
detail::function::useless_clear_type*)
{
@@ -768,7 +768,7 @@
}
#endif
-#ifdef BOOST_NO_SFINAE
+#ifdef NDNBOOST_NO_SFINAE
// Comparisons between ndnboost::function objects and arbitrary function objects
template<typename Functor>
inline bool operator==(const function_base& f, Functor g)
@@ -804,7 +804,7 @@
// objects. GCC 3.3 and before has an obnoxious bug that prevents this
// from working.
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator==(const function_base& f, Functor g)
{
if (const Functor* fp = f.template target<Functor>())
@@ -813,7 +813,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator==(Functor g, const function_base& f)
{
if (const Functor* fp = f.template target<Functor>())
@@ -822,7 +822,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator!=(const function_base& f, Functor g)
{
if (const Functor* fp = f.template target<Functor>())
@@ -831,7 +831,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator!=(Functor g, const function_base& f)
{
if (const Functor* fp = f.template target<Functor>())
@@ -841,7 +841,7 @@
# endif
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator==(const function_base& f, reference_wrapper<Functor> g)
{
if (const Functor* fp = f.template target<Functor>())
@@ -850,7 +850,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator==(reference_wrapper<Functor> g, const function_base& f)
{
if (const Functor* fp = f.template target<Functor>())
@@ -859,7 +859,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator!=(const function_base& f, reference_wrapper<Functor> g)
{
if (const Functor* fp = f.template target<Functor>())
@@ -868,7 +868,7 @@
}
template<typename Functor>
- BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
operator!=(reference_wrapper<Functor> g, const function_base& f)
{
if (const Functor* fp = f.template target<Functor>())
@@ -885,7 +885,7 @@
return f->empty();
}
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
+#if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, <= 1310)
inline bool has_empty_target(const void*)
{
return false;
@@ -900,11 +900,11 @@
} // end namespace detail
} // end namespace ndnboost
-#undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL
-#undef BOOST_FUNCTION_COMPARE_TYPE_ID
+#undef NDNBOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL
+#undef NDNBOOST_FUNCTION_COMPARE_TYPE_ID
-#if defined(BOOST_MSVC)
+#if defined(NDNBOOST_MSVC)
# pragma warning( pop )
#endif
-#endif // BOOST_FUNCTION_BASE_HEADER
+#endif // NDNBOOST_FUNCTION_BASE_HEADER