Commit 21b3b318 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Always disable conversion warnings when including boost header files

On one of my compile platforms, GCC was giving conversion warnings from
any boost include that was not wrapped in pragmas to disable conversion
warnings. To make things easier and more robust, I created a pair of
macros, VTKM_BOOST_PRE_INCLUDE and VTKM_BOOST_POST_INCLUDE, that should
be wrapped around any #include of a boost header file.
parent 5e5203d6
......@@ -24,8 +24,10 @@
#include <vtkm/internal/ExportMacros.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_base_of.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
......
......@@ -38,14 +38,17 @@
// boost seems to want to undefine those macros so that it can implement the
// C99 templates and other implementations of the same name. Get around the
// problem by using the boost version when compiling for a CPU.
VTKM_BOOST_PRE_INCLUDE
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/special_functions/sign.hpp>
VTKM_BOOST_POST_INCLUDE
#include <cmath>
#define VTKM_USE_BOOST_CLASSIFY
#define VTKM_USE_BOOST_SIGN
#endif // !VTKM_CUDA
#if defined(VTKM_MSVC) && !defined(VTKM_CUDA)
VTKM_BOOST_PRE_INCLUDE
#include <boost/math/special_functions/acosh.hpp>
#include <boost/math/special_functions/asinh.hpp>
#include <boost/math/special_functions/atanh.hpp>
......@@ -53,6 +56,7 @@
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/round.hpp>
VTKM_BOOST_POST_INCLUDE
#define VTKM_USE_BOOST_MATH
#if _MSC_VER <= 1600
#define VTKM_USE_STL_MIN_MAX
......
......@@ -50,14 +50,17 @@ $# Ignore the following comment. It is meant for the generated file.
// boost seems to want to undefine those macros so that it can implement the
// C99 templates and other implementations of the same name. Get around the
// problem by using the boost version when compiling for a CPU.
VTKM_BOOST_PRE_INCLUDE
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/special_functions/sign.hpp>
VTKM_BOOST_POST_INCLUDE
#include <cmath>
#define VTKM_USE_BOOST_CLASSIFY
#define VTKM_USE_BOOST_SIGN
#endif // !VTKM_CUDA
#if defined(VTKM_MSVC) && !defined(VTKM_CUDA)
VTKM_BOOST_PRE_INCLUDE
#include <boost/math/special_functions/acosh.hpp>
#include <boost/math/special_functions/asinh.hpp>
#include <boost/math/special_functions/atanh.hpp>
......@@ -65,6 +68,7 @@ $# Ignore the following comment. It is meant for the generated file.
#include <boost/math/special_functions/expm1.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/round.hpp>
VTKM_BOOST_POST_INCLUDE
#define VTKM_USE_BOOST_MATH
#if _MSC_VER <= 1600
#define VTKM_USE_STL_MIN_MAX
......
......@@ -27,7 +27,9 @@
#include <vtkm/cont/TopologyType.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/static_assert.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
......
......@@ -24,10 +24,12 @@
#include <vtkm/internal/Configure.h>
#include <vtkm/internal/ExportMacros.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_signed.hpp>
#include <boost/utility/enable_if.hpp>
VTKM_BOOST_POST_INCLUDE
/*!
* \namespace vtkm
......
......@@ -22,7 +22,9 @@
#include <vtkm/Types.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/type_traits/remove_const.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
......
......@@ -37,7 +37,9 @@
#include <vtkm/cont/testing/Testing.h>
#include <vtkm/benchmarking/Benchmarker.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/random.hpp>
VTKM_BOOST_POST_INCLUDE
#include <algorithm>
#include <cmath>
......
......@@ -31,11 +31,13 @@
#include <vtkm/cont/internal/ArrayHandleExecutionManager.h>
#include <vtkm/cont/internal/DeviceAdapterTag.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/concept_check.hpp>
#include <boost/mpl/not.hpp>
#include <boost/smart_ptr/scoped_ptr.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/type_traits/is_base_of.hpp>
VTKM_BOOST_POST_INCLUDE
#include <vector>
......
......@@ -28,7 +28,9 @@
#include <vtkm/internal/FunctionInterface.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/static_assert.hpp>
VTKM_BOOST_POST_INCLUDE
#include <sstream>
......
......@@ -27,7 +27,9 @@
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/type_traits/is_base_of.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -29,8 +29,10 @@
#include <vtkm/cont/internal/DynamicTransform.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/utility/enable_if.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -27,7 +27,9 @@
#include <vtkm/cont/internal/DynamicTransform.h>
#include <vtkm/cont/internal/SimplePolymorphicContainer.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/smart_ptr/shared_ptr.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -27,7 +27,9 @@
#include <vtkm/cont/internal/DynamicTransform.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/shared_ptr.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -28,7 +28,11 @@
#define VTKM_STORAGE VTKM_STORAGE_BASIC
#endif
#include <vtkm/internal/ExportMacros.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/static_assert.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -20,8 +20,12 @@
#ifndef vtk_m_cont_arg_ControlSignatureTagBase_h
#define vtk_m_cont_arg_ControlSignatureTagBase_h
#include <vtkm/internal/ExportMacros.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_base_of.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -26,8 +26,10 @@
#include <vtkm/exec/ExecutionObjectBase.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_base_of.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -20,11 +20,15 @@
#ifndef vtk_m_cont_arg_TypeCheckTagExecObject_h
#define vtk_m_cont_arg_TypeCheckTagExecObject_h
#include <vtkm/internal/ExportMacros.h>
#include <vtkm/cont/arg/TypeCheck.h>
#include <vtkm/exec/ExecutionObjectBase.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/type_traits/is_base_of.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
......@@ -30,8 +30,10 @@
#include <vtkm/exec/internal/ErrorMessageBuffer.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/iterator/counting_iterator.hpp>
#include <boost/utility/enable_if.hpp>
VTKM_BOOST_POST_INCLUDE
#include <algorithm>
#include <numeric>
......
......@@ -25,7 +25,9 @@
#include <string>
VTKM_BOOST_PRE_INCLUDE
#include <boost/static_assert.hpp>
VTKM_BOOST_POST_INCLUDE
#define VTKM_DEVICE_ADAPTER_ERROR -2
#define VTKM_DEVICE_ADAPTER_UNDEFINED -1
......
......@@ -24,7 +24,9 @@
#include <vtkm/cont/Assert.h>
VTKM_BOOST_PRE_INCLUDE
#include <boost/iterator/iterator_facade.hpp>
VTKM_BOOST_POST_INCLUDE
namespace vtkm {
namespace cont {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment