Autoware.Auto
common/measurement_conversion/include/measurement_conversion/visibility_control.hpp
Go to the documentation of this file.
1 // Copyright 2021 The Autoware Foundation
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 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
16 
17 #ifndef MEASUREMENT_CONVERSION__VISIBILITY_CONTROL_HPP_
18 #define MEASUREMENT_CONVERSION__VISIBILITY_CONTROL_HPP_
19 
21 #if defined(__WIN32)
22  #if defined(MEASUREMENT_CONVERSION_BUILDING_DLL) || defined(MEASUREMENT_CONVERSION_EXPORTS)
23  #define MEASUREMENT_CONVERSION_PUBLIC __declspec(dllexport)
24  #define MEASUREMENT_CONVERSION_LOCAL
25  #else // defined(MEASUREMENT_CONVERSION_BUILDING_DLL) || defined(MEASUREMENT_CONVERSION_EXPORTS)
26  #define MEASUREMENT_CONVERSION_PUBLIC __declspec(dllimport)
27  #define MEASUREMENT_CONVERSION_LOCAL
28  #endif // defined(MEASUREMENT_CONVERSION_BUILDING_DLL) || defined(MEASUREMENT_CONVERSION_EXPORTS)
29 #elif defined(__linux__)
30  #define MEASUREMENT_CONVERSION_PUBLIC __attribute__((visibility("default")))
31  #define MEASUREMENT_CONVERSION_LOCAL __attribute__((visibility("hidden")))
32 #elif defined(__APPLE__)
33  #define MEASUREMENT_CONVERSION_PUBLIC __attribute__((visibility("default")))
34  #define MEASUREMENT_CONVERSION_LOCAL __attribute__((visibility("hidden")))
35 #else
36  #error "Unsupported Build Configuration"
37 #endif
38 
39 #endif // MEASUREMENT_CONVERSION__VISIBILITY_CONTROL_HPP_