Add third party wrappers around boost macros.

The boost assert macros seem to have an issue where they define an
unused typedef. This is causing the XCode 7 compiler to issue a warning.
Since the offending code is in a macro, the warning is identified with
the VTK-m header even though the code is in boost. To get around this,
wrap all uses of the boost assert that is causing the warning in the
third party pre/post macros to disable the warning.
This commit is contained in:
Kenneth Moreland 2015-09-16 23:34:49 -06:00
parent 27c4f47411
commit 2ff6576c65
10 changed files with 27 additions and 7 deletions

@ -75,9 +75,11 @@ struct CellShapeTagCheck : boost::false_type { };
/// tag. /// tag.
/// ///
#define VTKM_IS_CELL_SHAPE_TAG(tag) \ #define VTKM_IS_CELL_SHAPE_TAG(tag) \
VTKM_THIRDPARTY_PRE_INCLUDE \
BOOST_STATIC_ASSERT_MSG( \ BOOST_STATIC_ASSERT_MSG( \
::vtkm::internal::CellShapeTagCheck<tag>::value, \ ::vtkm::internal::CellShapeTagCheck<tag>::value, \
"Provided type is not a valid VTK-m cell shape tag.") "Provided type is not a valid VTK-m cell shape tag.") \
VTKM_THIRDPARTY_POST_INCLUDE
/// A traits-like class to get an CellShapeId known at compile time to a tag. /// A traits-like class to get an CellShapeId known at compile time to a tag.
/// ///

@ -48,9 +48,11 @@ struct ListTagCheck
/// code when a mistake is made.) /// code when a mistake is made.)
/// ///
#define VTKM_IS_LIST_TAG(tag) \ #define VTKM_IS_LIST_TAG(tag) \
VTKM_THIRDPARTY_PRE_INCLUDE \
BOOST_STATIC_ASSERT_MSG( \ BOOST_STATIC_ASSERT_MSG( \
::vtkm::internal::ListTagCheck<tag>::Valid, \ ::vtkm::internal::ListTagCheck<tag>::Valid, \
"Provided type is not a valid VTK-m list tag.") "Provided type is not a valid VTK-m list tag.") \
VTKM_THIRDPARTY_POST_INCLUDE
namespace detail { namespace detail {

@ -95,7 +95,9 @@ struct CellSetCheck
}; };
#define VTKM_IS_CELL_SET(T) \ #define VTKM_IS_CELL_SET(T) \
BOOST_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value) VTKM_THIRDPARTY_PRE_INCLUDE \
BOOST_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value) \
VTKM_THIRDPARTY_POST_INCLUDE
} // namespace internal } // namespace internal

@ -62,9 +62,11 @@ struct ControlSignatureTagCheck
/// get weird errors elsewhere in the code when a mistake is made.) /// get weird errors elsewhere in the code when a mistake is made.)
/// ///
#define VTKM_IS_CONTROL_SIGNATURE_TAG(tag) \ #define VTKM_IS_CONTROL_SIGNATURE_TAG(tag) \
VTKM_THIRDPARTY_PRE_INCLUDE \
BOOST_STATIC_ASSERT_MSG( \ BOOST_STATIC_ASSERT_MSG( \
::vtkm::cont::arg::internal::ControlSignatureTagCheck<tag>::Valid, \ ::vtkm::cont::arg::internal::ControlSignatureTagCheck<tag>::Valid, \
"Provided a type that is not a valid ControlSignature tag.") "Provided a type that is not a valid ControlSignature tag.") \
VTKM_THIRDPARTY_POST_INCLUDE
} }
} }

@ -86,9 +86,11 @@ struct DeviceAdapterTagCheck
/// elsewhere in the code when a mistake is made.) /// elsewhere in the code when a mistake is made.)
/// ///
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \ #define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
VTKM_THIRDPARTY_PRE_INCLUDE \
BOOST_STATIC_ASSERT_MSG( \ BOOST_STATIC_ASSERT_MSG( \
::vtkm::cont::internal::DeviceAdapterTagCheck<tag>::Valid, \ ::vtkm::cont::internal::DeviceAdapterTagCheck<tag>::Valid, \
"Provided type is not a valid VTK-m device adapter tag.") "Provided type is not a valid VTK-m device adapter tag.") \
VTKM_THIRDPARTY_POST_INCLUDE
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_SERIAL #if VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_SERIAL

@ -64,9 +64,11 @@ struct ExecutionSignatureTagCheck
/// get weird errors elsewhere in the code when a mistake is made.) /// get weird errors elsewhere in the code when a mistake is made.)
/// ///
#define VTKM_IS_EXECUTION_SIGNATURE_TAG(tag) \ #define VTKM_IS_EXECUTION_SIGNATURE_TAG(tag) \
VTKM_THIRDPARTY_PRE_INCLUDE \
BOOST_STATIC_ASSERT_MSG( \ BOOST_STATIC_ASSERT_MSG( \
::vtkm::exec::arg::internal::ExecutionSignatureTagCheck<tag>::Valid, \ ::vtkm::exec::arg::internal::ExecutionSignatureTagCheck<tag>::Valid, \
"Provided a type that is not a valid ExecutionSignature tag.") "Provided a type that is not a valid ExecutionSignature tag.") \
VTKM_THIRDPARTY_POST_INCLUDE
} }
} }

@ -76,7 +76,9 @@ void GetMinMaxPoints(CellShapeTag,
{ {
// If this line fails, then MAX_POINTS is not large enough to support all // If this line fails, then MAX_POINTS is not large enough to support all
// cell shapes. // cell shapes.
VTKM_THIRDPARTY_PRE_INCLUDE
BOOST_STATIC_ASSERT((vtkm::CellTraits<CellShapeTag>::NUM_POINTS <= MAX_POINTS)); BOOST_STATIC_ASSERT((vtkm::CellTraits<CellShapeTag>::NUM_POINTS <= MAX_POINTS));
VTKM_THIRDPARTY_POST_INCLUDE
minPoints = maxPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS; minPoints = maxPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS;
} }

@ -45,7 +45,9 @@ void GetMinMaxPoints(CellShapeTag,
{ {
// If this line fails, then MAX_POINTS is not large enough to support all // If this line fails, then MAX_POINTS is not large enough to support all
// cell shapes. // cell shapes.
VTKM_THIRDPARTY_PRE_INCLUDE
BOOST_STATIC_ASSERT((vtkm::CellTraits<CellShapeTag>::NUM_POINTS <= MAX_POINTS)); BOOST_STATIC_ASSERT((vtkm::CellTraits<CellShapeTag>::NUM_POINTS <= MAX_POINTS));
VTKM_THIRDPARTY_POST_INCLUDE
minPoints = maxPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS; minPoints = maxPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS;
} }

@ -48,7 +48,9 @@ void GetMinMaxPoints(CellShapeTag,
{ {
// If this line fails, then MAX_POINTS is not large enough to support all // If this line fails, then MAX_POINTS is not large enough to support all
// cell shapes. // cell shapes.
VTKM_THIRDPARTY_PRE_INCLUDE
BOOST_STATIC_ASSERT((vtkm::CellTraits<CellShapeTag>::NUM_POINTS <= MAX_POINTS)); BOOST_STATIC_ASSERT((vtkm::CellTraits<CellShapeTag>::NUM_POINTS <= MAX_POINTS));
VTKM_THIRDPARTY_POST_INCLUDE
minPoints = maxPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS; minPoints = maxPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS;
} }

@ -264,10 +264,12 @@ private:
const vtkm::internal::FunctionInterface<Signature> &parameters) const const vtkm::internal::FunctionInterface<Signature> &parameters) const
{ {
typedef vtkm::internal::FunctionInterface<Signature> ParameterInterface; typedef vtkm::internal::FunctionInterface<Signature> ParameterInterface;
VTKM_THIRDPARTY_PRE_INCLUDE
BOOST_STATIC_ASSERT_MSG(ParameterInterface::ARITY == NUM_INVOKE_PARAMS, BOOST_STATIC_ASSERT_MSG(ParameterInterface::ARITY == NUM_INVOKE_PARAMS,
"Dispatcher Invoke called with wrong number of arguments."); "Dispatcher Invoke called with wrong number of arguments.");
BOOST_MPL_ASSERT(( boost::is_base_of<BaseWorkletType,WorkletType> )); BOOST_MPL_ASSERT(( boost::is_base_of<BaseWorkletType,WorkletType> ));
VTKM_THIRDPARTY_POST_INCLUDE
// As we do the dynamic transform, we are also going to check the static // As we do the dynamic transform, we are also going to check the static
// type against the TypeCheckTag in the ControlSignature tags. To do this, // type against the TypeCheckTag in the ControlSignature tags. To do this,