ros2_control - humble
Loading...
Searching...
No Matches
visibility_control.hpp
1// Copyright 2017 Open Source Robotics Foundation, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/* This header must be included by all rclcpp headers which declare symbols
16 * which are defined in the rclcpp library. When not building the rclcpp
17 * library, i.e. when using the headers in other package's code, the contents
18 * of this header change the visibility of certain symbols which the rclcpp
19 * library cannot have, but the consuming code must have inorder to link.
20 */
21
22#ifndef GRIPPER_CONTROLLERS__VISIBILITY_CONTROL_HPP_
23#define GRIPPER_CONTROLLERS__VISIBILITY_CONTROL_HPP_
24
25// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
26// https://gcc.gnu.org/wiki/Visibility
27
28#if defined _WIN32 || defined __CYGWIN__
29#ifdef __GNUC__
30#define GRIPPER_ACTION_CONTROLLER_EXPORT __attribute__((dllexport))
31#define GRIPPER_ACTION_CONTROLLER_IMPORT __attribute__((dllimport))
32#else
33#define GRIPPER_ACTION_CONTROLLER_EXPORT __declspec(dllexport)
34#define GRIPPER_ACTION_CONTROLLER_IMPORT __declspec(dllimport)
35#endif
36#ifdef GRIPPER_ACTION_CONTROLLER_BUILDING_DLL
37#define GRIPPER_ACTION_CONTROLLER_PUBLIC GRIPPER_ACTION_CONTROLLER_EXPORT
38#else
39#define GRIPPER_ACTION_CONTROLLER_PUBLIC GRIPPER_ACTION_CONTROLLER_IMPORT
40#endif
41#define GRIPPER_ACTION_CONTROLLER_PUBLIC_TYPE GRIPPER_ACTION_CONTROLLER_PUBLIC
42#define GRIPPER_ACTION_CONTROLLER_LOCAL
43#else
44#define GRIPPER_ACTION_CONTROLLER_EXPORT __attribute__((visibility("default")))
45#define GRIPPER_ACTION_CONTROLLER_IMPORT
46#if __GNUC__ >= 4
47#define GRIPPER_ACTION_CONTROLLER_PUBLIC __attribute__((visibility("default")))
48#define GRIPPER_ACTION_CONTROLLER_LOCAL __attribute__((visibility("hidden")))
49#else
50#define GRIPPER_ACTION_CONTROLLER_PUBLIC
51#define GRIPPER_ACTION_CONTROLLER_LOCAL
52#endif
53#define GRIPPER_ACTION_CONTROLLER_PUBLIC_TYPE
54#endif
55
56#endif // GRIPPER_CONTROLLERS__VISIBILITY_CONTROL_HPP_