Swarm API

Helpers.hh
1 /*
2  * Copyright (C) 2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef __SWARM_HELPERS_HH_INCLUDED__
19 #define __SWARM_HELPERS_HH_INCLUDED__
20 
23 
26 
27 #if defined BUILDING_STATIC_LIBS
28  #define IGNITION_VISIBLE
29  #define IGNITION_MSGS_VISIBLE
30  #define IGNITION_HIDDEN
31 #else
32  #if defined __WIN32 || defined __CYGWIN__
33  #ifdef BUILDING_DLL
34  #ifdef __GNUC__
35  #define IGNITION_VISIBLE __attribute__ ((dllexport))
36  #else
37  #define IGNITION_VISIBLE __declspec(dllexport)
38  #endif
39  #else
40  #ifdef __GNUC__
41  #define IGNITION_VISIBLE __attribute__ ((dllimport))
42  #else
43  #define IGNITION_VISIBLE __declspec(dllimport)
44  #endif
45  #endif
46  #define IGNITION_HIDDEN
47  #else
48  #if __GNUC__ >= 4
49  #define IGNITION_VISIBLE __attribute__ ((visibility ("default")))
50  #define IGNITION_HIDDEN __attribute__ ((visibility ("hidden")))
51  #else
52  #define IGNITION_VISIBLE
53  #define IGNITION_HIDDEN
54  #endif
55  #endif
56 
57  #if defined _WIN32 || defined __CYGWIN__
58  #ifdef BUILDING_DLL_IGNITION_MSGS
59  #ifdef __GNUC__
60  #define IGNITION_MSGS_VISIBLE __attribute__ ((dllexport))
61  #else
62  #define IGNITION_MSGS_VISIBLE __declspec(dllexport)
63  #endif
64  #else
65  #ifdef __GNUC__
66  #define IGNITION_MSGS_VISIBLE __attribute__ ((dllimport))
67  #else
68  #define IGNITION_MSGS_VISIBLE __declspec(dllimport)
69  #endif
70  #endif
71  #define IGNITION_MSGS_HIDDEN
72  #else
73  #if __GNUC__ >= 4
74  #define IGNITION_MSGS_VISIBLE __attribute__ ((visibility ("default")))
75  #define IGNITION_MSGS_HIDDEN __attribute__ ((visibility ("hidden")))
76  #else
77  #define IGNITION_MSGS_VISIBLE
78  #define IGNITION_MSGS_HIDDEN
79  #endif
80  #endif
81 // BUILDING_STATIC_LIBS
82 #endif
83 
84 // __SWARM_HELPERS_HH_INCLUDED__
85 #endif