scenario_simulator_v2 C++ API
visibility.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
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 #ifndef OPENSCENARIO_INTERPRETER__UTILITY__VISIBILITY_H_
16 #define OPENSCENARIO_INTERPRETER__UTILITY__VISIBILITY_H_
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 // This logic was borrowed (then namespaced) from the examples on the gcc wiki:
23 // https://gcc.gnu.org/wiki/Visibility
24 #if defined _WIN32 || defined __CYGWIN__
25 #ifdef __GNUC__
26 #define OPENSCENARIO_INTERPRETER_EXPORT __attribute__((dllexport))
27 #define OPENSCENARIO_INTERPRETER_IMPORT __attribute__((dllimport))
28 #else
29 #define OPENSCENARIO_INTERPRETER_EXPORT __declspec(dllexport)
30 #define OPENSCENARIO_INTERPRETER_IMPORT __declspec(dllimport)
31 #endif
32 
33 #ifdef OPENSCENARIO_INTERPRETER_BUILDING_DLL
34 #define OPENSCENARIO_INTERPRETER_PUBLIC OPENSCENARIO_INTERPRETER_EXPORT
35 #else
36 #define OPENSCENARIO_INTERPRETER_PUBLIC OPENSCENARIO_INTERPRETER_IMPORT
37 #endif
38 
39 #define OPENSCENARIO_INTERPRETER_PUBLIC_TYPE OPENSCENARIO_INTERPRETER_PUBLIC
40 #define OPENSCENARIO_INTERPRETER_LOCAL
41 #else
42 #define OPENSCENARIO_INTERPRETER_EXPORT __attribute__((visibility("default")))
43 #define OPENSCENARIO_INTERPRETER_IMPORT
44 
45 #if __GNUC__ >= 4
46 #define OPENSCENARIO_INTERPRETER_PUBLIC __attribute__((visibility("default")))
47 #define OPENSCENARIO_INTERPRETER_LOCAL __attribute__((visibility("hidden")))
48 #else
49 #define OPENSCENARIO_INTERPRETER_PUBLIC
50 #define OPENSCENARIO_INTERPRETER_LOCAL
51 #endif
52 
53 #define OPENSCENARIO_INTERPRETER_PUBLIC_TYPE
54 #endif
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif // OPENSCENARIO_INTERPRETER__UTILITY__VISIBILITY_H_