Closed mfueller closed 7 years ago
I never had the usecase. But thanks for pointing it out and providing the fix.
Did you really mean several configs per package or per node? Because I think you can have several executables in a package without conflicts.
mhh, I think I was wrong and it is several config files per package. It happens when you compile one node with several config files.
If I now think one step further, you might get the same trouble when you have two config files from two different packages compiled in one node. I think the #ifndef UTIL_FUNCTIONS_${pkgname}
statement should be changed to a general #ifndef ROSPARAM_HANDLER_UTIL_FUNCTIONS
statement. What do you think?
If the two configs come from different packages, they will be in different namespaces and should be ok.
When using multiple configuration files in one package, you will get a "redefinition" error during the compilation, e.g:
... <myConfig>Parameters.h:27:20: error: redefinition of 'std::__cxx11::string <myPackageName>:getNodeName(const ros::NodeHandle&)'
The attached preprocessor statements avoid the redefinition.