File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 2424#include " rcutils/types/string_array.h"
2525
2626#include " rcpputils/find_library.hpp"
27+ #include " rcpputils/get_env.hpp"
2728#include " rcpputils/shared_library.hpp"
2829
2930#include " rmw/error_handling.h"
3839#define STRINGIFY_ (s ) #s
3940#define STRINGIFY (s ) STRINGIFY_(s)
4041
41- std::string get_env_var (const char * env_var)
42- {
43- const char * value{};
44- const char * err = rcutils_get_env (env_var, &value);
45- if (err) {
46- throw std::runtime_error (err);
47- }
48- return value ? value : " " ;
49- }
50-
5142std::shared_ptr<rcpputils::SharedLibrary>
5243get_library ()
5344{
5445 static std::shared_ptr<rcpputils::SharedLibrary> lib;
5546
5647 if (!lib) {
57- std::string env_var = get_env_var (" RMW_IMPLEMENTATION" );
48+ std::string env_var = rcpputils:: get_env_var (" RMW_IMPLEMENTATION" );
5849 if (env_var.empty ()) {
5950 env_var = STRINGIFY (DEFAULT_RMW_IMPLEMENTATION);
6051 }
You can’t perform that action at this time.
0 commit comments