From e00b105fce38e3d6952c4e2b93286e6ae948a5a4 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 20 Jul 2017 13:40:34 -0500 Subject: [PATCH] Adding inspect checks for HPX macros/related includes --- .../server/template_accumulator.hpp | 4 ++- .../partitioned_vector_component.hpp | 1 + .../partition_unordered_map_component.hpp | 2 ++ hpx/config/boost/compiler/intel.hpp | 2 ++ hpx/include/util.hpp | 2 ++ hpx/lcos/base_lco_with_value.hpp | 1 + hpx/lcos/broadcast.hpp | 1 + hpx/lcos/fold.hpp | 1 + hpx/lcos/gather.hpp | 1 + hpx/lcos/reduce.hpp | 1 + hpx/lcos/server/channel.hpp | 4 +++ hpx/lcos/server/queue.hpp | 3 ++ .../boost_simd/vector_pack_alignment_size.hpp | 4 +-- ...oalescing_message_handler_registration.hpp | 3 ++ hpx/plugins/plugin_registry.hpp | 1 + hpx/runtime/actions/basic_action.hpp | 1 + hpx/runtime/actions/component_action.hpp | 1 + hpx/runtime/actions/detail/action_factory.hpp | 7 ++-- hpx/runtime/actions/plain_action.hpp | 1 + .../actions/transfer_continuation_action.hpp | 10 +++--- hpx/runtime/actions/trigger.hpp | 3 +- hpx/runtime/components/component_factory.hpp | 1 + hpx/runtime/components/component_registry.hpp | 1 + .../components/component_startup_shutdown.hpp | 1 + .../components/derived_component_factory.hpp | 1 + .../server/distributed_metadata_base.hpp | 2 ++ .../components/static_factory_data.hpp | 1 + hpx/runtime/serialization/container.hpp | 3 +- .../polymorphic_nonintrusive_factory.hpp | 2 ++ .../serialization/serialization_chunk.hpp | 3 +- hpx/runtime_impl.hpp | 3 +- hpx/util/detail/pp/cat.hpp | 7 ++-- hpx/util/detail/pp/config.hpp | 34 +++++++++++++++---- hpx/util/detail/pp/expand.hpp | 15 ++++++++ hpx/util/detail/pp/nargs.hpp | 4 ++- hpx/util/detail/pp/stringize.hpp | 2 ++ hpx/util/detail/pp/strip_parens.hpp | 7 ++-- hpx/util/functional/colocated_helpers.hpp | 10 +++--- plugins/parcelport/parcelport_logging.hpp | 1 + plugins/parcelport/verbs/parcelport_verbs.cpp | 7 ++-- .../parcelport/verbs/rdma/rdma_logging.hpp | 1 + src/runtime/parcelset/parcelhandler.cpp | 32 ++++++++--------- src/util/command_line_handling.cpp | 1 + src/util/runtime_configuration.cpp | 26 +++++++------- .../performance/local/agas_cache_timings.cpp | 1 + tests/performance/local/sizeof.cpp | 1 + tests/performance/network/osu/broadcast.hpp | 1 + tools/inspect/deprecated_include_check.cpp | 2 ++ tools/inspect/deprecated_name_check.cpp | 4 +++ tools/inspect/include_check.cpp | 6 ++++ 50 files changed, 174 insertions(+), 60 deletions(-) create mode 100644 hpx/util/detail/pp/expand.hpp diff --git a/examples/accumulators/server/template_accumulator.hpp b/examples/accumulators/server/template_accumulator.hpp index a3a71f1d9db8..f87ba8e80c05 100644 --- a/examples/accumulators/server/template_accumulator.hpp +++ b/examples/accumulators/server/template_accumulator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2016 Hartmut Kaiser +// Copyright (c) 2007-2017 Hartmut Kaiser // Copyright (c) 2011 Bryce Adelstein-Lelbach // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,6 +10,8 @@ #include #include +#include + /////////////////////////////////////////////////////////////////////////////// namespace examples { namespace server { diff --git a/hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp b/hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp index c64b644540da..7dde16b0049a 100644 --- a/hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp +++ b/hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include diff --git a/hpx/components/containers/unordered/partition_unordered_map_component.hpp b/hpx/components/containers/unordered/partition_unordered_map_component.hpp index 0ab00d5eef08..4ce1d33dcb4b 100644 --- a/hpx/components/containers/unordered/partition_unordered_map_component.hpp +++ b/hpx/components/containers/unordered/partition_unordered_map_component.hpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include diff --git a/hpx/config/boost/compiler/intel.hpp b/hpx/config/boost/compiler/intel.hpp index 11bec531d7c1..c2c5e19c0c7e 100644 --- a/hpx/config/boost/compiler/intel.hpp +++ b/hpx/config/boost/compiler/intel.hpp @@ -12,6 +12,8 @@ // See http://www.boost.org for most recent version. +// hpxinspect:noinclude:BOOST_STRINGIZE + // make sure header testing does not throw errors #if defined(__INTEL_COMPILER) diff --git a/hpx/include/util.hpp b/hpx/include/util.hpp index 5b94b366aed7..a6a23ec4d5ba 100644 --- a/hpx/include/util.hpp +++ b/hpx/include/util.hpp @@ -14,7 +14,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/hpx/lcos/base_lco_with_value.hpp b/hpx/lcos/base_lco_with_value.hpp index 8be31a5ea19b..01f8c47e9c0d 100644 --- a/hpx/lcos/base_lco_with_value.hpp +++ b/hpx/lcos/base_lco_with_value.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/lcos/broadcast.hpp b/hpx/lcos/broadcast.hpp index 88a55712c145..53f4cb1a90d4 100644 --- a/hpx/lcos/broadcast.hpp +++ b/hpx/lcos/broadcast.hpp @@ -147,6 +147,7 @@ namespace hpx { namespace lcos #include #include #include +#include #include #include #include diff --git a/hpx/lcos/fold.hpp b/hpx/lcos/fold.hpp index 2efbdacb5b8e..1e937e7caca8 100644 --- a/hpx/lcos/fold.hpp +++ b/hpx/lcos/fold.hpp @@ -177,6 +177,7 @@ namespace hpx { namespace lcos #include #include #include +#include #include #include #include diff --git a/hpx/lcos/gather.hpp b/hpx/lcos/gather.hpp index 5d7564ac01c8..5a4f3d46d72b 100644 --- a/hpx/lcos/gather.hpp +++ b/hpx/lcos/gather.hpp @@ -205,6 +205,7 @@ namespace hpx { namespace lcos #include #include #include +#include #include #include diff --git a/hpx/lcos/reduce.hpp b/hpx/lcos/reduce.hpp index 6977361d1ff0..a381aa2ade88 100644 --- a/hpx/lcos/reduce.hpp +++ b/hpx/lcos/reduce.hpp @@ -90,6 +90,7 @@ namespace hpx { namespace lcos #include #include #include +#include #include #include #include diff --git a/hpx/lcos/server/channel.hpp b/hpx/lcos/server/channel.hpp index be7e4965f786..747faf667cf8 100644 --- a/hpx/lcos/server/channel.hpp +++ b/hpx/lcos/server/channel.hpp @@ -14,6 +14,10 @@ #include #include #include +#include +#include +#include +#include #include #include diff --git a/hpx/lcos/server/queue.hpp b/hpx/lcos/server/queue.hpp index b6be8d0364d9..cef649cb825c 100644 --- a/hpx/lcos/server/queue.hpp +++ b/hpx/lcos/server/queue.hpp @@ -18,7 +18,10 @@ #include #include #include +#include +#include #include +#include #include #include diff --git a/hpx/parallel/traits/detail/boost_simd/vector_pack_alignment_size.hpp b/hpx/parallel/traits/detail/boost_simd/vector_pack_alignment_size.hpp index b8c2f08fd772..4d175118d752 100644 --- a/hpx/parallel/traits/detail/boost_simd/vector_pack_alignment_size.hpp +++ b/hpx/parallel/traits/detail/boost_simd/vector_pack_alignment_size.hpp @@ -3,8 +3,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#if !defined(HPX_PARALLEL_TRAITS_VECTOR_PACK_ALIGNMENT_SIZE_BOOST_SIMD_SEP_29_2016_0905PM) -#define HPX_PARALLEL_TRAITS_VECTOR_PACK_ALIGNMENT_SIZE_BOOST_SIMD_SEP_29_2016_0905PM +#if !defined(HPX_PARALLEL_VECTOR_PACK_ALIGNMENT_SIZE_BOOST_SIMD_SEP_29_2016_0905PM) +#define HPX_PARALLEL_VECTOR_PACK_ALIGNMENT_SIZE_BOOST_SIMD_SEP_29_2016_0905PM #include diff --git a/hpx/plugins/parcel/coalescing_message_handler_registration.hpp b/hpx/plugins/parcel/coalescing_message_handler_registration.hpp index 6f3148dcf9b7..588f4ec069d8 100644 --- a/hpx/plugins/parcel/coalescing_message_handler_registration.hpp +++ b/hpx/plugins/parcel/coalescing_message_handler_registration.hpp @@ -18,6 +18,9 @@ #include #include #include +#include +#include +#include #include diff --git a/hpx/plugins/plugin_registry.hpp b/hpx/plugins/plugin_registry.hpp index 24627793400c..a374654dc0be 100644 --- a/hpx/plugins/plugin_registry.hpp +++ b/hpx/plugins/plugin_registry.hpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/hpx/runtime/actions/basic_action.hpp b/hpx/runtime/actions/basic_action.hpp index 8f3e7426f808..ba6ff3af778b 100644 --- a/hpx/runtime/actions/basic_action.hpp +++ b/hpx/runtime/actions/basic_action.hpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/runtime/actions/component_action.hpp b/hpx/runtime/actions/component_action.hpp index 27cd3be61c0b..6b65fda24773 100644 --- a/hpx/runtime/actions/component_action.hpp +++ b/hpx/runtime/actions/component_action.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/runtime/actions/detail/action_factory.hpp b/hpx/runtime/actions/detail/action_factory.hpp index 06736ba917c1..472c172063f6 100644 --- a/hpx/runtime/actions/detail/action_factory.hpp +++ b/hpx/runtime/actions/detail/action_factory.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -32,8 +33,10 @@ namespace hpx { namespace actions { namespace detail HPX_STATIC_CONSTEXPR std::uint32_t invalid_id = ~0; HPX_EXPORT action_registry(); - HPX_EXPORT void register_factory(std::string const& type_name, ctor_t ctor); - HPX_EXPORT void register_typename(std::string const& type_name, std::uint32_t id); + HPX_EXPORT void register_factory(std::string const& type_name, + ctor_t ctor); + HPX_EXPORT void register_typename(std::string const& type_name, + std::uint32_t id); HPX_EXPORT void fill_missing_typenames(); HPX_EXPORT std::uint32_t try_get_id(std::string const& type_name) const; HPX_EXPORT std::vector get_unassigned_typenames() const; diff --git a/hpx/runtime/actions/plain_action.hpp b/hpx/runtime/actions/plain_action.hpp index aa92b8c3cf88..953a676e3702 100644 --- a/hpx/runtime/actions/plain_action.hpp +++ b/hpx/runtime/actions/plain_action.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/runtime/actions/transfer_continuation_action.hpp b/hpx/runtime/actions/transfer_continuation_action.hpp index e2295afd7e4d..2d0d9da8651a 100644 --- a/hpx/runtime/actions/transfer_continuation_action.hpp +++ b/hpx/runtime/actions/transfer_continuation_action.hpp @@ -38,7 +38,8 @@ namespace hpx { namespace actions typedef transfer_base_action base_type; typedef typename base_type::continuation_type continuation_type; public: - // construct an empty transfer_continuation_action to avoid serialization overhead + // construct an empty transfer_continuation_action to avoid serialization + // overhead transfer_continuation_action(); // construct an action from its arguments @@ -71,7 +72,8 @@ namespace hpx { namespace actions naming::id_type&& target, naming::address::address_type lva); threads::thread_function_type - get_thread_function(naming::id_type&& target, naming::address::address_type lva); + get_thread_function(naming::id_type&& target, + naming::address::address_type lva); template void @@ -215,8 +217,8 @@ namespace hpx { namespace actions if (deferred_schedule) { - // If this is a direct action and deferred schedule was requested, that - // is we are not the last parcel, return immediately + // If this is a direct action and deferred schedule was requested, + // that is we are not the last parcel, return immediately if (base_type::direct_execution::value) return; diff --git a/hpx/runtime/actions/trigger.hpp b/hpx/runtime/actions/trigger.hpp index e2ddd0465574..d9c0a43acd5e 100644 --- a/hpx/runtime/actions/trigger.hpp +++ b/hpx/runtime/actions/trigger.hpp @@ -105,7 +105,8 @@ namespace hpx { namespace actions { // Overload when return type is "void" aka util::unused_type template - void trigger_impl(std::true_type, typed_continuation&& cont, + void trigger_impl(std::true_type, + typed_continuation&& cont, F&& f, Ts&&... vs) { try { diff --git a/hpx/runtime/components/component_factory.hpp b/hpx/runtime/components/component_factory.hpp index 227cf32f0fa9..1b4abc355a54 100644 --- a/hpx/runtime/components/component_factory.hpp +++ b/hpx/runtime/components/component_factory.hpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/runtime/components/component_registry.hpp b/hpx/runtime/components/component_registry.hpp index f2c30678eb0f..9961da344a89 100644 --- a/hpx/runtime/components/component_registry.hpp +++ b/hpx/runtime/components/component_registry.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/runtime/components/component_startup_shutdown.hpp b/hpx/runtime/components/component_startup_shutdown.hpp index 12c82d503ac9..ebe3bf643ebc 100644 --- a/hpx/runtime/components/component_startup_shutdown.hpp +++ b/hpx/runtime/components/component_startup_shutdown.hpp @@ -8,6 +8,7 @@ #include #include +#include /////////////////////////////////////////////////////////////////////////////// namespace hpx { namespace components diff --git a/hpx/runtime/components/derived_component_factory.hpp b/hpx/runtime/components/derived_component_factory.hpp index 1683ee27bcfa..e1d7cec489f4 100644 --- a/hpx/runtime/components/derived_component_factory.hpp +++ b/hpx/runtime/components/derived_component_factory.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/hpx/runtime/components/server/distributed_metadata_base.hpp b/hpx/runtime/components/server/distributed_metadata_base.hpp index b3872e99f7b9..87a3e2f78e5a 100644 --- a/hpx/runtime/components/server/distributed_metadata_base.hpp +++ b/hpx/runtime/components/server/distributed_metadata_base.hpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include diff --git a/hpx/runtime/components/static_factory_data.hpp b/hpx/runtime/components/static_factory_data.hpp index 4048cfcf48c3..63cddcd652c7 100644 --- a/hpx/runtime/components/static_factory_data.hpp +++ b/hpx/runtime/components/static_factory_data.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/hpx/runtime/serialization/container.hpp b/hpx/runtime/serialization/container.hpp index 674fda1bb6d0..8df7c4d08453 100644 --- a/hpx/runtime/serialization/container.hpp +++ b/hpx/runtime/serialization/container.hpp @@ -31,7 +31,8 @@ namespace hpx { namespace serialization naming::gid_type const & split_gid) = 0; virtual void set_filter(binary_filter* filter) = 0; virtual void save_binary(void const* address, std::size_t count) = 0; - virtual std::size_t save_binary_chunk(void const* address, std::size_t count) = 0; + virtual std::size_t save_binary_chunk( + void const* address, std::size_t count) = 0; virtual void reset() = 0; virtual std::size_t get_num_chunks() const = 0; virtual void flush() = 0; diff --git a/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp b/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp index dbeed98a830d..414ed55e0fd1 100644 --- a/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp +++ b/hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include diff --git a/hpx/runtime/serialization/serialization_chunk.hpp b/hpx/runtime/serialization/serialization_chunk.hpp index 2733799db68b..4ff20da5ce8b 100644 --- a/hpx/runtime/serialization/serialization_chunk.hpp +++ b/hpx/runtime/serialization/serialization_chunk.hpp @@ -38,7 +38,8 @@ namespace hpx { namespace serialization { chunk_data data_; // index or pointer std::size_t size_; // size of the serialization_chunk starting index_/pos_ - std::uint64_t rkey_; // optional RDMA remote key for parcelport put/get operations + std::uint64_t rkey_; // optional RDMA remote key for parcelport put/get + // operations std::uint8_t type_; // chunk_type }; diff --git a/hpx/runtime_impl.hpp b/hpx/runtime_impl.hpp index 93e7f6cc0003..c3f1b7d0cb65 100644 --- a/hpx/runtime_impl.hpp +++ b/hpx/runtime_impl.hpp @@ -144,7 +144,8 @@ namespace hpx /// return immediately. Use a second call to stop /// with this parameter set to \a true to wait for /// all internal work to be completed. - void stopped(bool blocking, compat::condition_variable& cond, compat::mutex& mtx); + void stopped(bool blocking, compat::condition_variable& cond, + compat::mutex& mtx); /// \brief Report a non-recoverable error to the runtime system /// diff --git a/hpx/util/detail/pp/cat.hpp b/hpx/util/detail/pp/cat.hpp index 30782e364c32..41516a0dc17a 100644 --- a/hpx/util/detail/pp/cat.hpp +++ b/hpx/util/detail/pp/cat.hpp @@ -1,6 +1,6 @@ // Copyright (c) 2017 Hartmut Kaiser // -// Distributed under the HPX Software License, Version 1.0. (See accompanying +// Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.HPX.org/LICENSE_1_0.txt) /* Copyright (C) 2001 @@ -10,6 +10,8 @@ /* Revised by Paul Mensonides (2002) */ +// hpxinspect:noinclude:HPX_PP_CAT + #ifndef HPX_UTIL_DETAIL_CAT_HPP_INCLUDED #define HPX_UTIL_DETAIL_CAT_HPP_INCLUDED @@ -22,7 +24,8 @@ # define HPX_PP_CAT_OO(par) HPX_PP_CAT_I ## par # endif # -# if (~HPX_PP_CONFIG_FLAGS() & HPX_PP_CONFIG_MSVC()) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) +# if (~HPX_PP_CONFIG_FLAGS() & HPX_PP_CONFIG_MSVC()) || \ + (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) # define HPX_PP_CAT_I(a, b) a ## b # else # define HPX_PP_CAT_I(a, b) HPX_PP_CAT_II(~, a ## b) diff --git a/hpx/util/detail/pp/config.hpp b/hpx/util/detail/pp/config.hpp index eff29bbe6a97..07f6e6bc052a 100644 --- a/hpx/util/detail/pp/config.hpp +++ b/hpx/util/detail/pp/config.hpp @@ -37,10 +37,12 @@ # elif defined(_MWERKS_) && _MWERKS_ >= 0x3200 # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_STRICT()) # elif defined(_EDG_) || defined(_EDG_VERSION_) -# if defined(_MSC_VER) && (defined(_clang_) || defined(_INTELLISENSE_) || _EDG_VERSION_ >= 308) +# if defined(_MSC_VER) && (defined(_clang_) || \ + defined(_INTELLISENSE_) || _EDG_VERSION_ >= 308) # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_MSVC()) # else -# define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_EDG() | HPX_PP_CONFIG_STRICT()) +# define HPX_PP_CONFIG_FLAGS() \ + (HPX_PP_CONFIG_EDG() | HPX_PP_CONFIG_STRICT()) # endif # elif defined(_MWERKS_) # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_MWCC()) @@ -48,7 +50,8 @@ # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_DMC()) # elif defined(_BORLANDC_) && _BORLANDC_ >= 0x581 # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_STRICT()) -# elif defined(_BORLANDC_) || defined(_IBMC_) || defined(_IBMCPP_) || defined(_SUNPRO_CC) +# elif defined(_BORLANDC_) || defined(_IBMC_) || defined(_IBMCPP_) || \ + defined(_SUNPRO_CC) # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_BCC()) # elif defined(_MSC_VER) # define HPX_PP_CONFIG_FLAGS() (HPX_PP_CONFIG_MSVC()) @@ -78,15 +81,23 @@ # define HPX_UTIL_VARIADICS_MSVC 0 # if !defined HPX_UTIL_VARIADICS # /* variadic support explicitly disabled for all untested compilers */ -# if defined _GCCXML_ || defined _CUDACC_ || defined _PATHSCALE_ || defined _DMC_ || defined _CODEGEARC_ || defined _BORLANDC_ || defined _MWERKS_ || ( defined _SUNPRO_CC && _SUNPRO_CC < 0x5120 ) || defined _HP_aCC && !defined _EDG_ || defined _MRC_ || defined _SC_ || defined _IBMCPP_ || defined _PGI +# if defined _GCCXML_ || defined _CUDACC_ || defined _PATHSCALE_ || \ + defined _DMC_ || defined _CODEGEARC_ || defined _BORLANDC_ || \ + defined _MWERKS_ || ( defined _SUNPRO_CC && _SUNPRO_CC < 0x5120 ) || \ + defined _HP_aCC && !defined _EDG_ || defined _MRC_ || defined _SC_ || \ + defined _IBMCPP_ || defined _PGI # define HPX_UTIL_VARIADICS 0 # /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */ -# elif defined _MSC_VER && _MSC_VER >= 1400 && (defined(_clang_) || !defined _EDG_ || defined(_INTELLISENSE_) || defined(_INTEL_COMPILER) && _INTEL_COMPILER >= 1700) +# elif defined _MSC_VER && _MSC_VER >= 1400 && ( \ + defined(_clang_) || !defined _EDG_ || defined(_INTELLISENSE_) || \ + defined(_INTEL_COMPILER) && _INTEL_COMPILER >= 1700 \ + ) # define HPX_UTIL_VARIADICS 1 # undef HPX_UTIL_VARIADICS_MSVC # define HPX_UTIL_VARIADICS_MSVC 1 # /* Wave (C/C++), GCC (C++) */ -# elif defined _WAVE_ && _WAVE_HAS_VARIADICS_ || defined _GNUC_ && defined _GXX_EXPERIMENTAL_CXX0X_ && _GXX_EXPERIMENTAL_CXX0X_ +# elif defined _WAVE_ && _WAVE_HAS_VARIADICS_ || defined _GNUC_ && \ + defined _GXX_EXPERIMENTAL_CXX0X_ && _GXX_EXPERIMENTAL_CXX0X_ # define HPX_UTIL_VARIADICS 1 # /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */ # elif !defined _cplusplus && _STDC_VERSION_ >= 199901L || _cplusplus >= 201103L @@ -97,7 +108,16 @@ # elif !HPX_UTIL_VARIADICS + 1 < 2 # undef HPX_UTIL_VARIADICS # define HPX_UTIL_VARIADICS 1 -# if defined _MSC_VER && _MSC_VER >= 1400 && (defined(_clang_) || defined(_INTELLISENSE_) || (defined(_INTEL_COMPILER) && _INTEL_COMPILER >= 1700) || !(defined _EDG_ || defined _GCCXML_ || defined _CUDACC_ || defined _PATHSCALE_ || defined _DMC_ || defined _CODEGEARC_ || defined _BORLANDC_ || defined _MWERKS_ || defined _SUNPRO_CC || defined _HP_aCC || defined _MRC_ || defined _SC_ || defined _IBMCPP_ || defined _PGI)) +# if defined _MSC_VER && _MSC_VER >= 1400 && ( \ + defined(_clang_) || defined(_INTELLISENSE_) || \ + (defined(_INTEL_COMPILER) && _INTEL_COMPILER >= 1700) || !( \ + defined _EDG_ || defined _GCCXML_ || defined _CUDACC_ || \ + defined _PATHSCALE_ || defined _DMC_ || defined _CODEGEARC_ || \ + defined _BORLANDC_ || defined _MWERKS_ || defined _SUNPRO_CC || \ + defined _HP_aCC || defined _MRC_ || defined _SC_ || \ + defined _IBMCPP_ || defined _PGI \ + ) \ + ) # undef HPX_UTIL_VARIADICS_MSVC # define HPX_UTIL_VARIADICS_MSVC 1 # endif diff --git a/hpx/util/detail/pp/expand.hpp b/hpx/util/detail/pp/expand.hpp new file mode 100644 index 000000000000..ab6cb562a137 --- /dev/null +++ b/hpx/util/detail/pp/expand.hpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017 Hartmut Kaiser +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef HPX_UTIL_DETAIL_PP_EXPAND_HPP_INCLUDED +#define HPX_UTIL_DETAIL_PP_EXPAND_HPP_INCLUDED + +// hpxinspect:noinclude:HPX_PP_EXPAND + +#define HPX_PP_EXPAND(x) x + +#endif + + diff --git a/hpx/util/detail/pp/nargs.hpp b/hpx/util/detail/pp/nargs.hpp index c6f59c49becc..4771c1f1c4bd 100644 --- a/hpx/util/detail/pp/nargs.hpp +++ b/hpx/util/detail/pp/nargs.hpp @@ -6,7 +6,9 @@ #ifndef HPX_UTIL_DETAIL_PP_NARG_HPP_INCLUDED #define HPX_UTIL_DETAIL_PP_NARG_HPP_INCLUDED -#define HPX_PP_EXPAND(x) x +// hpxinspect:noinclude:HPX_PP_NARGS + +#include #define HPX_PP_NARGS(...) \ HPX_PP_EXPAND(HPX_UTIL_PP_ARGN_(__VA_ARGS__, \ diff --git a/hpx/util/detail/pp/stringize.hpp b/hpx/util/detail/pp/stringize.hpp index 1ad55eccd710..3e7861994eff 100644 --- a/hpx/util/detail/pp/stringize.hpp +++ b/hpx/util/detail/pp/stringize.hpp @@ -16,6 +16,8 @@ /* See http://www.HPX.org for most recent version. */ +// hpxinspect:noinclude:HPX_PP_STRINGIZE + # ifndef HPX_UTIL_DETAIL_STRINGIZE_HPP # define HPX_UTIL_DETAIL_STRINGIZE_HPP diff --git a/hpx/util/detail/pp/strip_parens.hpp b/hpx/util/detail/pp/strip_parens.hpp index 6156d8107361..47054b576472 100644 --- a/hpx/util/detail/pp/strip_parens.hpp +++ b/hpx/util/detail/pp/strip_parens.hpp @@ -7,8 +7,11 @@ // http://www.boost.org/LICENSE_1_0.txt //============================================================================== // modified to fit HPX macro nameing scheme -#ifndef HPX_PP_DETAIL_STRIP_HPP_INCLUDED -#define HPX_PP_DETAIL_STRIP_HPP_INCLUDED + +// hpxinspect:noinclude:HPX_PP_STRIP_PARENS + +#ifndef HPX_PP_DETAIL_STRIP_PARENS_HPP_INCLUDED +#define HPX_PP_DETAIL_STRIP_PARENS_HPP_INCLUDED #include diff --git a/hpx/util/functional/colocated_helpers.hpp b/hpx/util/functional/colocated_helpers.hpp index d96caa22942a..0d5bfb525f18 100644 --- a/hpx/util/functional/colocated_helpers.hpp +++ b/hpx/util/functional/colocated_helpers.hpp @@ -175,8 +175,9 @@ namespace hpx { namespace util { namespace functional functional::detail::apply_continuation_impl apply_continuation(Bound && bound) { - return functional::detail::apply_continuation_impl( - std::forward(bound)); + return functional::detail::apply_continuation_impl< + Bound, hpx::util::unused_type + >(std::forward(bound)); } template @@ -317,8 +318,9 @@ namespace hpx { namespace util { namespace functional functional::detail::async_continuation_impl async_continuation(Bound && bound) { - return functional::detail::async_continuation_impl( - std::forward(bound)); + return functional::detail::async_continuation_impl< + Bound, hpx::util::unused_type + >(std::forward(bound)); } template diff --git a/plugins/parcelport/parcelport_logging.hpp b/plugins/parcelport/parcelport_logging.hpp index 72f210166d87..d1049c13c5a8 100644 --- a/plugins/parcelport/parcelport_logging.hpp +++ b/plugins/parcelport/parcelport_logging.hpp @@ -16,6 +16,7 @@ #include #include #include +#include // #include diff --git a/plugins/parcelport/verbs/parcelport_verbs.cpp b/plugins/parcelport/verbs/parcelport_verbs.cpp index 7e0c89dbe5ea..f12e2e06f01a 100644 --- a/plugins/parcelport/verbs/parcelport_verbs.cpp +++ b/plugins/parcelport/verbs/parcelport_verbs.cpp @@ -8,11 +8,12 @@ #if defined(HPX_HAVE_NETWORKING) // util -#include -#include -#include #include #include +#include +#include +#include +#include // The memory pool specialization need to be pulled in before encode_parcels #include diff --git a/plugins/parcelport/verbs/rdma/rdma_logging.hpp b/plugins/parcelport/verbs/rdma/rdma_logging.hpp index 53d4bf01ef5f..c9327e6d1b90 100644 --- a/plugins/parcelport/verbs/rdma/rdma_logging.hpp +++ b/plugins/parcelport/verbs/rdma/rdma_logging.hpp @@ -14,6 +14,7 @@ // #include #include +#include // #include // diff --git a/src/runtime/parcelset/parcelhandler.cpp b/src/runtime/parcelset/parcelhandler.cpp index d007ddaa164e..3b01f7ba0360 100644 --- a/src/runtime/parcelset/parcelhandler.cpp +++ b/src/runtime/parcelset/parcelhandler.cpp @@ -7,34 +7,34 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include -#include #include -#include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include #include +#include +#include +#include +#include #include #include +#include +#include +#include #include diff --git a/src/util/command_line_handling.cpp b/src/util/command_line_handling.cpp index c7ef0b12e8fd..a8f71b5501ff 100644 --- a/src/util/command_line_handling.cpp +++ b/src/util/command_line_handling.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/src/util/runtime_configuration.cpp b/src/util/runtime_configuration.cpp index c304d65a8d91..ebb9897743ca 100644 --- a/src/util/runtime_configuration.cpp +++ b/src/util/runtime_configuration.cpp @@ -9,6 +9,7 @@ #include // TODO: move parcel ports into plugins #include +#include #include #include #include @@ -190,9 +191,9 @@ namespace hpx { namespace util "${HPX_MAX_BACKGROUND_THREADS:$[hpx.os_threads]}", "max_idle_loop_count = ${HPX_MAX_IDLE_LOOP_COUNT:" - BOOST_STRINGIZE(HPX_IDLE_LOOP_COUNT_MAX) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_IDLE_LOOP_COUNT_MAX)) "}", "max_busy_loop_count = ${HPX_MAX_BUSY_LOOP_COUNT:" - BOOST_STRINGIZE(HPX_BUSY_LOOP_COUNT_MAX) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_BUSY_LOOP_COUNT_MAX)) "}", // arity for collective operations implemented in a tree fashion "[hpx.lcos.collectives]", @@ -211,24 +212,24 @@ namespace hpx { namespace util "[hpx.stacks]", "small_size = ${HPX_SMALL_STACK_SIZE:" - HPX_PP_STRINGIZE(HPX_SMALL_STACK_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_SMALL_STACK_SIZE)) "}", "medium_size = ${HPX_MEDIUM_STACK_SIZE:" - HPX_PP_STRINGIZE(HPX_MEDIUM_STACK_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_MEDIUM_STACK_SIZE)) "}", "large_size = ${HPX_LARGE_STACK_SIZE:" - HPX_PP_STRINGIZE(HPX_LARGE_STACK_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_LARGE_STACK_SIZE)) "}", "huge_size = ${HPX_HUGE_STACK_SIZE:" - HPX_PP_STRINGIZE(HPX_HUGE_STACK_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_HUGE_STACK_SIZE)) "}", #if defined(__linux) || defined(linux) || defined(__linux__) || defined(__FreeBSD__) "use_guard_pages = ${HPX_USE_GUARD_PAGES:1}", #endif "[hpx.threadpools]", "io_pool_size = ${HPX_NUM_IO_POOL_SIZE:" - HPX_PP_STRINGIZE(HPX_NUM_IO_POOL_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_NUM_IO_POOL_SIZE)) "}", "parcel_pool_size = ${HPX_NUM_PARCEL_POOL_SIZE:" - HPX_PP_STRINGIZE(HPX_NUM_PARCEL_POOL_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_NUM_PARCEL_POOL_SIZE)) "}", "timer_pool_size = ${HPX_NUM_TIMER_POOL_SIZE:" - HPX_PP_STRINGIZE(HPX_NUM_TIMER_POOL_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_NUM_TIMER_POOL_SIZE)) "}", "[hpx.thread_queue]", "min_tasks_to_steal_pending = " @@ -276,14 +277,15 @@ namespace hpx { namespace util // command_line_handling.cpp "address = ${HPX_AGAS_SERVER_ADDRESS}", "port = ${HPX_AGAS_SERVER_PORT:" - HPX_PP_STRINGIZE(HPX_INITIAL_IP_PORT) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_INITIAL_IP_PORT)) "}", "max_pending_refcnt_requests = " "${HPX_AGAS_MAX_PENDING_REFCNT_REQUESTS:" - HPX_PP_STRINGIZE(HPX_INITIAL_AGAS_MAX_PENDING_REFCNT_REQUESTS) + HPX_PP_STRINGIZE(HPX_PP_EXPAND( + HPX_INITIAL_AGAS_MAX_PENDING_REFCNT_REQUESTS)) "}", "service_mode = hosted", "local_cache_size = ${HPX_AGAS_LOCAL_CACHE_SIZE:" - HPX_PP_STRINGIZE(HPX_AGAS_LOCAL_CACHE_SIZE) "}", + HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_AGAS_LOCAL_CACHE_SIZE)) "}", "use_range_caching = ${HPX_AGAS_USE_RANGE_CACHING:1}", "use_caching = ${HPX_AGAS_USE_CACHING:1}", diff --git a/tests/performance/local/agas_cache_timings.cpp b/tests/performance/local/agas_cache_timings.cpp index 8c2d664c5ec6..ad9a552fb451 100644 --- a/tests/performance/local/agas_cache_timings.cpp +++ b/tests/performance/local/agas_cache_timings.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/tests/performance/local/sizeof.cpp b/tests/performance/local/sizeof.cpp index aa19a8c2f6ce..cec9949ac122 100644 --- a/tests/performance/local/sizeof.cpp +++ b/tests/performance/local/sizeof.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include diff --git a/tests/performance/network/osu/broadcast.hpp b/tests/performance/network/osu/broadcast.hpp index 9b9a75e830eb..14af588e4b01 100644 --- a/tests/performance/network/osu/broadcast.hpp +++ b/tests/performance/network/osu/broadcast.hpp @@ -4,6 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include diff --git a/tools/inspect/deprecated_include_check.cpp b/tools/inspect/deprecated_include_check.cpp index 5674bd82d615..0a147b9469f1 100644 --- a/tools/inspect/deprecated_include_check.cpp +++ b/tools/inspect/deprecated_include_check.cpp @@ -41,6 +41,8 @@ namespace boost { "boost/exception_ptr\\.hpp", "exception" }, { "boost/range/iterator_range\\.hpp", "hpx/util/iterator_range.hpp" }, { "hpx/hpx_fwd\\.hpp", "nothing (remove unconditionally)" }, + { "boost/preprocessor/cat\\.hpp", "hpx/util/detail/pp/cat.hpp" }, + { "boost/preprocessor/stringize\\.hpp", "hpx/util/detail/pp/stringize.hpp" }, { nullptr, nullptr } }; diff --git a/tools/inspect/deprecated_name_check.cpp b/tools/inspect/deprecated_name_check.cpp index 0f418245cfaa..9b7e594e6693 100644 --- a/tools/inspect/deprecated_name_check.cpp +++ b/tools/inspect/deprecated_name_check.cpp @@ -85,6 +85,10 @@ namespace boost { "((\\bhpx::\\b)?\\btraits\\s*::\\bis_callable\\b)", "\\2traits::is_invocable[_r]" }, { "((\\bhpx::\\b)?\\butil\\s*::\\bresult_of\\b)", "\\2util::invoke_result" }, { "(\\bNULL\\b)", "nullptr" }, + // Boost preprocessor macros + { "\\b(BOOST_PP_CAT)\\b", "HPX_PP_CAT" }, + { "\\b(BOOST_PP_STRINGIZE)\\b", "HPX_PP_STRINGIZE" }, + { "\\b(BOOST_STRINGIZE)\\b", "HPX_PP_STRINGIZE(HPX_PP_EXPAND())" }, { nullptr, nullptr } }; diff --git a/tools/inspect/include_check.cpp b/tools/inspect/include_check.cpp index b25eb5aa402d..e61787babe6e 100644 --- a/tools/inspect/include_check.cpp +++ b/tools/inspect/include_check.cpp @@ -156,6 +156,12 @@ namespace boost // boost { "(\\bboost\\s*::\\s*atomic\\b)", "boost::atomic", "boost/atomic.hpp" }, { "(\\bboost\\s*::\\s*intrusive_ptr\\b)", "boost::intrusive_ptr", "boost/intrusive_ptr.hpp" }, + // macros + { "(\\bHPX_PP_CAT\\b)", "HPX_PP_CAT", "hpx/util/detail/pp/cat.hpp" }, + { "(\\bHPX_PP_EXPAND\\b)", "HPX_PP_EXPAND", "hpx/util/detail/pp/expand.hpp" }, + { "(\\bHPX_PP_NARGS\\b)", "HPX_PP_NARGS", "hpx/util/detail/pp/nargs.hpp" }, + { "(\\bHPX_PP_STRINGIZE\\b)", "HPX_PP_STRINGIZE", "hpx/util/detail/pp/stringize.hpp" }, + { "(\\bHPX_PP_STRIP_PARENS\\b)", "HPX_PP_STRIP_PARENS", "hpx/util/detail/pp/strip_parens.hpp" }, { nullptr, nullptr, nullptr } };