rcpputils  master
C++ API providing common utilities and data structures.
visibility_control.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019, Open Source Robotics Foundation, Inc.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 //
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 //
13 // * Neither the name of the copyright holder nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 // POSSIBILITY OF SUCH DAMAGE.
28 
29 #ifndef RCPPUTILS__VISIBILITY_CONTROL_HPP_
30 #define RCPPUTILS__VISIBILITY_CONTROL_HPP_
31 
59 #if defined _WIN32 || defined __CYGWIN__
60  #ifdef __GNUC__
61  #define RCPPUTILS_EXPORT __attribute__ ((dllexport))
62  #define RCPPUTILS_IMPORT __attribute__ ((dllimport))
63  #else
64  #define RCPPUTILS_EXPORT __declspec(dllexport)
65  #define RCPPUTILS_IMPORT __declspec(dllimport)
66  #endif
67  #ifdef RCPPUTILS_BUILDING_LIBRARY
68  #define RCPPUTILS_PUBLIC RCPPUTILS_EXPORT
69  #else
70  #define RCPPUTILS_PUBLIC RCPPUTILS_IMPORT
71  #endif
72  #define RCPPUTILS_PUBLIC_TYPE RCPPUTILS_PUBLIC
73  #define RCPPUTILS_LOCAL
74 #else
75  #define RCPPUTILS_EXPORT __attribute__ ((visibility("default")))
76  #define RCPPUTILS_IMPORT
77  #if __GNUC__ >= 4
78  #define RCPPUTILS_PUBLIC __attribute__ ((visibility("default")))
79  #define RCPPUTILS_LOCAL __attribute__ ((visibility("hidden")))
80  #else
81  #define RCPPUTILS_PUBLIC
82  #define RCPPUTILS_LOCAL
83  #endif
84  #define RCPPUTILS_PUBLIC_TYPE
85 #endif
86 
87 #endif // RCPPUTILS__VISIBILITY_CONTROL_HPP_