acados_solver_ros2  main
Acados-based NMPC controllers for ROS2 control
visibility_control.h
Go to the documentation of this file.
1 // Copyright 2023 ICUBE Laboratory, University of Strasbourg
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 // Author: Thibault Poignonec (tpoignonec@unistra.fr)
16 
17 #ifndef ACADOS_SOLVER_BASE__VISIBILITY_CONTROL_H_
18 #define ACADOS_SOLVER_BASE__VISIBILITY_CONTROL_H_
19 
20 // This logic was borrowed (then namespaced) from the examples on the gcc wiki:
21 // https://gcc.gnu.org/wiki/Visibility
22 
23 #if defined _WIN32 || defined __CYGWIN__
24  #ifdef __GNUC__
25  #define ACADOS_SOLVER_BASE_EXPORT __attribute__ ((dllexport))
26  #define ACADOS_SOLVER_BASE_IMPORT __attribute__ ((dllimport))
27  #else
28  #define ACADOS_SOLVER_BASE_EXPORT __declspec(dllexport)
29  #define ACADOS_SOLVER_BASE_IMPORT __declspec(dllimport)
30  #endif
31  #ifdef ACADOS_SOLVER_BASE_BUILDING_LIBRARY
32  #define ACADOS_SOLVER_BASE_PUBLIC ACADOS_SOLVER_BASE_EXPORT
33  #else
34  #define ACADOS_SOLVER_BASE_PUBLIC ACADOS_SOLVER_BASE_IMPORT
35  #endif
36  #define ACADOS_SOLVER_BASE_PUBLIC_TYPE ACADOS_SOLVER_BASE_PUBLIC
37  #define ACADOS_SOLVER_BASE_LOCAL
38 #else
39  #define ACADOS_SOLVER_BASE_EXPORT __attribute__ ((visibility("default")))
40  #define ACADOS_SOLVER_BASE_IMPORT
41  #if __GNUC__ >= 4
42  #define ACADOS_SOLVER_BASE_PUBLIC __attribute__ ((visibility("default")))
43  #define ACADOS_SOLVER_BASE_LOCAL __attribute__ ((visibility("hidden")))
44  #else
45  #define ACADOS_SOLVER_BASE_PUBLIC
46  #define ACADOS_SOLVER_BASE_LOCAL
47  #endif
48  #define ACADOS_SOLVER_BASE_PUBLIC_TYPE
49 #endif
50 
51 #endif // ACADOS_SOLVER_BASE__VISIBILITY_CONTROL_H_