Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Cousineau <eric.cousineau@tri.global>
  • Loading branch information
EricCousineau-TRI committed Sep 25, 2019
1 parent 7cf9920 commit ae7dc48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rmw_implementation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>rcpputils</build_depend>
<depend>rcpputils</depend>
<build_depend>rcutils</build_depend>
<build_depend>rmw</build_depend>
<!--
Expand Down
11 changes: 10 additions & 1 deletion rmw_implementation/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@
#define STRINGIFY_(s) #s
#define STRINGIFY(s) STRINGIFY_(s)

namespace {

Poco::SharedLibrary *
get_library()
{
static Poco::SharedLibrary * lib = nullptr;
if (!lib) {
const char * cenv_var = getenv("RMW_IMPLEMENTATION");
const char * cenv_var{};
const char * cenv_err = rcutils_get_env("RMW_IMPLEMENTATION", &cenv_var);
if (cenv_err) {
RMW_SET_ERROR_MSG(cenv_err);
return nullptr;
}
std::string env_var = cenv_var ? cenv_var : "";
if (env_var.empty()) {
env_var = STRINGIFY(DEFAULT_RMW_IMPLEMENTATION);
Expand Down Expand Up @@ -90,6 +97,8 @@ get_symbol(const char * symbol_name)
return lib->getSymbol(symbol_name);
}

}

#ifdef __cplusplus
extern "C"
{
Expand Down

0 comments on commit ae7dc48

Please sign in to comment.