Skip to content

redundancy: Offer centralized visibility macros? #164

@EricCousineau-TRI

Description

@EricCousineau-TRI

At present, from the crystal ros2 workspace, there are 43 instances of visibility_control.h*:

$ cd ros2_ws/src
$ find . -name 'visibility_control.h*' | wc -l
43

Only one is the *.em template file; the others only seem differ by the license header and the macro prefixes.
I could understand wanting to use project-specific visibility if it changes from project to project, but if it doesn't, wouldn't it make more sense to centralize them?

ament_cmake seems like a good candidate, as it's a build dependency, and thus something like this:

#include <ament_cmake/visibility_control.h>

AMENT_EXPORT
AMENT_IMPORT
AMENT_PUBLIC
// etc.

seems fine to me?

Related comment:
ros2/rcpputils#4 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions