Autoware.Auto
common/osqp_interface/include/osqp_interface/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 #ifndef OSQP_INTERFACE__VISIBILITY_CONTROL_HPP_
16 #define OSQP_INTERFACE__VISIBILITY_CONTROL_HPP_
17 
19 #if defined(__WIN32)
20  #if defined(OSQP_INTERFACE_BUILDING_DLL) || defined(OSQP_INTERFACE_EXPORTS)
21  #define OSQP_INTERFACE_PUBLIC __declspec(dllexport)
22  #define OSQP_INTERFACE_LOCAL
23  #else // defined(OSQP_INTERFACE_BUILDING_DLL) || defined(OSQP_INTERFACE_EXPORTS)
24  #define OSQP_INTERFACE_PUBLIC __declspec(dllimport)
25  #define OSQP_INTERFACE_LOCAL
26  #endif // defined(OSQP_INTERFACE_BUILDING_DLL) || defined(OSQP_INTERFACE_EXPORTS)
27 #elif defined(__linux__)
28  #define OSQP_INTERFACE_PUBLIC __attribute__((visibility("default")))
29  #define OSQP_INTERFACE_LOCAL __attribute__((visibility("hidden")))
30 #elif defined(__APPLE__)
31  #define OSQP_INTERFACE_PUBLIC __attribute__((visibility("default")))
32  #define OSQP_INTERFACE_LOCAL __attribute__((visibility("hidden")))
33 #else
34  #error "Unsupported Build Configuration"
35 #endif
36 
37 #endif // OSQP_INTERFACE__VISIBILITY_CONTROL_HPP_