Skip to content

Commit

Permalink
Fixing problem with gcc 4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sithhell committed Aug 21, 2015
1 parent 1290296 commit e6c78c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion hpx/runtime/parcelset/parcelport.hpp
Expand Up @@ -28,6 +28,12 @@

#include <hpx/config/warnings_prefix.hpp>

#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#define HPX_PARCELSET_PENDING_PARCELS_WORKAROUND
#elif defined(HPX_GCC_VERSION) && HPX_GCC_VERSION < 40700
#define HPX_PARCELSET_PENDING_PARCELS_WORKAROUND
#endif

///////////////////////////////////////////////////////////////////////////////
namespace hpx { namespace agas
{
Expand Down Expand Up @@ -359,7 +365,7 @@ namespace hpx { namespace parcelset
/// The cache for pending parcels
typedef std::list<naming::gid_type> new_gids_type;
typedef std::map<naming::gid_type, new_gids_type> new_gids_map;
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
typedef util::tuple<
boost::shared_ptr<std::vector<parcel> >
, std::vector<write_handler_type>
Expand Down
12 changes: 6 additions & 6 deletions hpx/runtime/parcelset/parcelport_impl.hpp
Expand Up @@ -572,7 +572,7 @@ namespace hpx { namespace parcelset
> il(&l);

mapped_type& e = pending_parcels_[locality_id];
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if(!util::get<0>(e))
util::get<0>(e) = boost::make_shared<std::vector<parcel> >();
util::get<0>(e)->push_back(std::move(p));
Expand Down Expand Up @@ -603,7 +603,7 @@ namespace hpx { namespace parcelset
HPX_ASSERT(parcels.size() == handlers.size());

mapped_type& e = pending_parcels_[locality_id];
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if(!util::get<0>(e))
{
util::get<0>(e) = boost::make_shared<std::vector<parcel> >();
Expand Down Expand Up @@ -631,7 +631,7 @@ namespace hpx { namespace parcelset
#endif
else
{
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
HPX_ASSERT(util::get<0>(e)->size() == util::get<1>(e).size());
std::size_t new_size = util::get<0>(e)->size() + parcels.size();
util::get<0>(e)->reserve(new_size);
Expand Down Expand Up @@ -673,15 +673,15 @@ namespace hpx { namespace parcelset

// do nothing if parcels have already been picked up by
// another thread
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if (it != pending_parcels_.end() && !util::get<0>(it->second)->empty())
#else
if (it != pending_parcels_.end() && !util::get<0>(it->second).empty())
#endif
{
HPX_ASSERT(it->first == locality_id);
HPX_ASSERT(handlers.size() == parcels.size());
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
std::swap(parcels, *util::get<0>(it->second));
#else
std::swap(parcels, util::get<0>(it->second));
Expand Down Expand Up @@ -854,7 +854,7 @@ namespace hpx { namespace parcelset

HPX_ASSERT(locality_id == sender_connection->destination());
pending_parcels_map::iterator it = pending_parcels_.find(locality_id);
#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400
#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND)
if (it == pending_parcels_.end() ||
(util::get<0>(it->second) && util::get<0>(it->second)->empty()))
#else
Expand Down

0 comments on commit e6c78c0

Please sign in to comment.