Skip to content

Commit

Permalink
Partially reverting 337639b, trying different solution. Additionally,…
Browse files Browse the repository at this point in the history
… this is a fix for #707: Many examples do not link with Git HEAD version
  • Loading branch information
hkaiser committed Feb 12, 2013
1 parent cbf3323 commit 5f71a10
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
14 changes: 7 additions & 7 deletions examples/quickstart/component_in_executable.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2012 Bryce Adelstein-Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// Copyright (c) 2012 Bryce Adelstein-Lelbach
//
// 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)
///////////////////////////////////////////////////////////////////////////////

Expand All @@ -23,7 +23,7 @@ using hpx::flush;

struct hello_world_server : managed_component_base<hello_world_server>
{
void print() const { cout << "hello world\n" << flush; }
void print() const { cout << "hello world\n" << flush; }

HPX_DEFINE_COMPONENT_CONST_ACTION(hello_world_server, print, print_action);
};
Expand All @@ -37,7 +37,7 @@ HPX_REGISTER_ACTION(print_action);

struct hello_world : client_base<hello_world, stub_base<hello_world_server> >
{
void print() { async<print_action>(this->get_gid()).get(); }
void print() { async<print_action>(this->get_gid()).get(); }
};

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -47,8 +47,8 @@ int main()

hw.create(find_here());

hw.print();
hw.print();

return 0;
return 0;
}

4 changes: 4 additions & 0 deletions hpx/config.hpp
Expand Up @@ -385,6 +385,10 @@
#endif

///////////////////////////////////////////////////////////////////////////////
#if !defined(HPX_COMPONENT_NAME)
# define HPX_COMPONENT_NAME hpx
#endif

#if !defined(HPX_COMPONENT_STRING)
# define HPX_COMPONENT_STRING BOOST_PP_STRINGIZE(HPX_COMPONENT_NAME)
#endif
Expand Down
9 changes: 8 additions & 1 deletion hpx/runtime/components/component_factory_base.hpp
Expand Up @@ -73,7 +73,7 @@ namespace hpx { namespace components
/// initialize the newly allocated object.
///
/// \return Returns the GID of the first newly created component
/// instance.
/// instance.
virtual naming::gid_type create_with_args(
HPX_STD_FUNCTION<void(void*)> const&) = 0;

Expand Down Expand Up @@ -143,12 +143,19 @@ namespace hpx { namespace util { namespace plugin
componentname, factory) \
/**/

///////////////////////////////////////////////////////////////////////////////
#if !defined(HPX_APPLICATION_NAME)
/// This macro is used to define the required Hpx.Plugin entry points. This
/// macro has to be used in exactly one compilation unit of a component module.
#define HPX_REGISTER_COMPONENT_MODULE() \
HPX_PLUGIN_EXPORT_LIST(HPX_PLUGIN_PREFIX, factory) \
HPX_REGISTER_REGISTRY_MODULE() \
/**/
#else
// in executables (when HPX_APPLICATION_NAME is defined) this needs to expand
// to nothing
#define HPX_REGISTER_COMPONENT_MODULE()
#endif

#endif

7 changes: 7 additions & 0 deletions hpx/runtime/components/component_registry_base.hpp
Expand Up @@ -45,11 +45,18 @@ namespace hpx { namespace components
componentname, registry) \
/**/

///////////////////////////////////////////////////////////////////////////////
#if !defined(HPX_APPLICATION_NAME)
/// This macro is used to define the required Hpx.Plugin entry points. This
/// macro has to be used in exactly one compilation unit of a component module.
#define HPX_REGISTER_REGISTRY_MODULE() \
HPX_PLUGIN_EXPORT_LIST(HPX_PLUGIN_PREFIX, registry) \
/**/
#else
// in executables (when HPX_APPLICATION_NAME is defined) this needs to expand
// to nothing
#define HPX_REGISTER_REGISTRY_MODULE()
#endif

#endif

0 comments on commit 5f71a10

Please sign in to comment.