rmw_fastrtps_cpp
master
Implement the ROS middleware interface using eProsima FastRTPS static code generation in C++.
Main Page
Namespaces
Namespace List
Namespace Members
All
Functions
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
Functions
Files
File List
File Members
All
Variables
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Macros
include
rmw_fastrtps_cpp
visibility_control.h
Go to the documentation of this file.
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 RMW_FASTRTPS_CPP__VISIBILITY_CONTROL_H_
23
#define RMW_FASTRTPS_CPP__VISIBILITY_CONTROL_H_
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 RMW_FASTRTPS_CPP_EXPORT __attribute__ ((dllexport))
31
#define RMW_FASTRTPS_CPP_IMPORT __attribute__ ((dllimport))
32
#else
33
#define RMW_FASTRTPS_CPP_EXPORT __declspec(dllexport)
34
#define RMW_FASTRTPS_CPP_IMPORT __declspec(dllimport)
35
#endif
36
#ifdef RMW_FASTRTPS_CPP_BUILDING_LIBRARY
37
#define RMW_FASTRTPS_CPP_PUBLIC RMW_FASTRTPS_CPP_EXPORT
38
#else
39
#define RMW_FASTRTPS_CPP_PUBLIC RMW_FASTRTPS_CPP_IMPORT
40
#endif
41
#define RMW_FASTRTPS_CPP_PUBLIC_TYPE RMW_FASTRTPS_CPP_PUBLIC
42
#define RMW_FASTRTPS_CPP_LOCAL
43
#else
44
#define RMW_FASTRTPS_CPP_EXPORT __attribute__ ((visibility("default")))
45
#define RMW_FASTRTPS_CPP_IMPORT
46
#if __GNUC__ >= 4
47
#define RMW_FASTRTPS_CPP_PUBLIC __attribute__ ((visibility("default")))
48
#define RMW_FASTRTPS_CPP_LOCAL __attribute__ ((visibility("hidden")))
49
#else
50
#define RMW_FASTRTPS_CPP_PUBLIC
51
#define RMW_FASTRTPS_CPP_LOCAL
52
#endif
53
#define RMW_FASTRTPS_CPP_PUBLIC_TYPE
54
#endif
55
56
#endif // RMW_FASTRTPS_CPP__VISIBILITY_CONTROL_H_
Generated by
1.8.17