ros2_control - humble
Loading...
Searching...
No Matches
visibility_control.h
1// Copyright 2022 Pixel Robotics.
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/*
16 * Author: Tony Najjar
17 */
18
19#ifndef TRICYCLE_CONTROLLER__VISIBILITY_CONTROL_H_
20#define TRICYCLE_CONTROLLER__VISIBILITY_CONTROL_H_
21
22// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
23// https://gcc.gnu.org/wiki/Visibility
24
25#if defined _WIN32 || defined __CYGWIN__
26#ifdef __GNUC__
27#define TRICYCLE_CONTROLLER_EXPORT __attribute__((dllexport))
28#define TRICYCLE_CONTROLLER_IMPORT __attribute__((dllimport))
29#else
30#define TRICYCLE_CONTROLLER_EXPORT __declspec(dllexport)
31#define TRICYCLE_CONTROLLER_IMPORT __declspec(dllimport)
32#endif
33#ifdef TRICYCLE_CONTROLLER_BUILDING_DLL
34#define TRICYCLE_CONTROLLER_PUBLIC TRICYCLE_CONTROLLER_EXPORT
35#else
36#define TRICYCLE_CONTROLLER_PUBLIC TRICYCLE_CONTROLLER_IMPORT
37#endif
38#define TRICYCLE_CONTROLLER_PUBLIC_TYPE TRICYCLE_CONTROLLER_PUBLIC
39#define TRICYCLE_CONTROLLER_LOCAL
40#else
41#define TRICYCLE_CONTROLLER_EXPORT __attribute__((visibility("default")))
42#define TRICYCLE_CONTROLLER_IMPORT
43#if __GNUC__ >= 4
44#define TRICYCLE_CONTROLLER_PUBLIC __attribute__((visibility("default")))
45#define TRICYCLE_CONTROLLER_LOCAL __attribute__((visibility("hidden")))
46#else
47#define TRICYCLE_CONTROLLER_PUBLIC
48#define TRICYCLE_CONTROLLER_LOCAL
49#endif
50#define TRICYCLE_CONTROLLER_PUBLIC_TYPE
51#endif
52
53#endif // TRICYCLE_CONTROLLER__VISIBILITY_CONTROL_H_