hpp-centroidal-dynamics  4.9.0
Utility classes for testing (robust) equilibrium of a system in contact with the environment, and other centroidal dynamics methods.
local_config.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2015, LAAS-CNRS
3  * Author: Andrea Del Prete
4  */
5 
6 #ifndef HPP_CENTROIDAL_DYNAMICS_LOCAL_CONFIG_HH
7 #define HPP_CENTROIDAL_DYNAMICS_LOCAL_CONFIG_HH
8 
9 // Package version (header).
10 #define CENTROIDAL_DYNAMICS_VERSION "UNKNOWN"
11 
12 // Handle portable symbol export.
13 // Defining manually which symbol should be exported is required
14 // under Windows whether MinGW or MSVC is used.
15 //
16 // The headers then have to be able to work in two different modes:
17 // - dllexport when one is building the library,
18 // - dllimport for clients using the library.
19 //
20 // On Linux, set the visibility accordingly. If C++ symbol visibility
21 // is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility
22 #if defined _WIN32 || defined __CYGWIN__
23 // On Microsoft Windows, use dllimport and dllexport to tag symbols.
24 #define CENTROIDAL_DYNAMICS_DLLIMPORT __declspec(dllimport)
25 #define CENTROIDAL_DYNAMICS_DLLEXPORT __declspec(dllexport)
26 #define CENTROIDAL_DYNAMICS_DLLLOCAL
27 #else
28 // On Linux, for GCC >= 4, tag symbols using GCC extension.
29 #if __GNUC__ >= 4
30 #define CENTROIDAL_DYNAMICS_DLLIMPORT __attribute__((visibility("default")))
31 #define CENTROIDAL_DYNAMICS_DLLEXPORT __attribute__((visibility("default")))
32 #define CENTROIDAL_DYNAMICS_DLLLOCAL __attribute__((visibility("hidden")))
33 #else
34 // Otherwise (GCC < 4 or another compiler is used), export everything.
35 #define CENTROIDAL_DYNAMICS_DLLIMPORT
36 #define CENTROIDAL_DYNAMICS_DLLEXPORT
37 #define CENTROIDAL_DYNAMICS_DLLLOCAL
38 #endif // __GNUC__ >= 4
39 #endif // defined _WIN32 || defined __CYGWIN__
40 
41 #ifdef CENTROIDAL_DYNAMICS_STATIC
42 // If one is using the library statically, get rid of
43 // extra information.
44 #define CENTROIDAL_DYNAMICS_DLLAPI
45 #define CENTROIDAL_DYNAMICS_LOCAL
46 #else
47 // Depending on whether one is building or using the
48 // library define DLLAPI to import or export.
49 #ifdef CENTROIDAL_DYNAMICS_EXPORTS
50 #define CENTROIDAL_DYNAMICS_DLLAPI CENTROIDAL_DYNAMICS_DLLEXPORT
51 #else
52 #define CENTROIDAL_DYNAMICS_DLLAPI CENTROIDAL_DYNAMICS_DLLIMPORT
53 #endif // CENTROIDAL_DYNAMICS_EXPORTS
54 #define CENTROIDAL_DYNAMICS_LOCAL CENTROIDAL_DYNAMICS_DLLLOCAL
55 #endif // CENTROIDAL_DYNAMICS_STATIC
56 
57 #endif // HPP_CENTROIDAL_DYNAMICS_LOCAL_CONFIG_HH