system.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 #ifndef _GAZEBO_VISIBLE_HH_
18 #define _GAZEBO_VISIBLE_HH_
19 
22 
25 
26 #if defined BUILDING_STATIC_LIBS
27  #define GAZEBO_VISIBLE
28  #define GZ_COMMON_VISIBLE
29  #define GZ_MATH_VISIBLE
30  #define GZ_TRANSPORT_VISIBLE
31  #define GZ_MSGS_VISIBLE
32  #define GZ_RENDERING_VISIBLE
33  #define GZ_UTIL_VISIBLE
34  #define GZ_PHYSICS_VISIBLE
35  #define GZ_GUI_VISIBLE
36  #define GZ_SENSORS_VISIBLE
37  #define GAZEBO_HIDDEN
38 #else
39  #if defined _WIN32 || defined __CYGWIN__
40  #ifdef BUILDING_DLL
41  #ifdef __GNUC__
42  #define GAZEBO_VISIBLE __attribute__ ((dllexport))
43  #else
44  #define GAZEBO_VISIBLE __declspec(dllexport)
45  #endif
46  #else
47  #ifdef __GNUC__
48  #define GAZEBO_VISIBLE __attribute__ ((dllimport))
49  #else
50  #define GAZEBO_VISIBLE __declspec(dllimport)
51  #endif
52  #endif
53  #define GAZEBO_HIDDEN
54  #else
55  #if __GNUC__ >= 4
56  #define GAZEBO_VISIBLE __attribute__ ((visibility ("default")))
57  #define GAZEBO_HIDDEN __attribute__ ((visibility ("hidden")))
58  #else
59  #define GAZEBO_VISIBLE
60  #define GAZEBO_HIDDEN
61  #endif
62  #endif
63 
64  #if defined _WIN32 || defined __CYGWIN__
65  #ifdef BUILDING_DLL_GZ_COMMON
66  #ifdef __GNUC__
67  #define GZ_COMMON_VISIBLE __attribute__ ((dllexport))
68  #else
69  #define GZ_COMMON_VISIBLE __declspec(dllexport)
70  #endif
71  #else
72  #ifdef __GNUC__
73  #define GZ_COMMON_VISIBLE __attribute__ ((dllimport))
74  #else
75  #define GZ_COMMON_VISIBLE __declspec(dllimport)
76  #endif
77  #endif
78  #define GZ_COMMON_HIDDEN
79  #else
80  #if __GNUC__ >= 4
81  #define GZ_COMMON_VISIBLE __attribute__ ((visibility ("default")))
82  #define GZ_COMMON_HIDDEN __attribute__ ((visibility ("hidden")))
83  #else
84  #define GZ_COMMON_VISIBLE
85  #define GZ_COMMON_HIDDEN
86  #endif
87  #endif
88 
89  #if defined _WIN32 || defined __CYGWIN__
90  #ifdef BUILDING_DLL_GZ_MATH
91  #ifdef __GNUC__
92  #define GZ_MATH_VISIBLE __attribute__ ((dllexport))
93  #else
94  #define GZ_MATH_VISIBLE __declspec(dllexport)
95  #endif
96  #else
97  #ifdef __GNUC__
98  #define GZ_MATH_VISIBLE __attribute__ ((dllimport))
99  #else
100  #define GZ_MATH_VISIBLE __declspec(dllimport)
101  #endif
102  #endif
103  #define GZ_MATH_HIDDEN
104  #else
105  #if __GNUC__ >= 4
106  #define GZ_MATH_VISIBLE __attribute__ ((visibility ("default")))
107  #define GZ_MATH_HIDDEN __attribute__ ((visibility ("hidden")))
108  #else
109  #define GZ_MATH_VISIBLE
110  #define GZ_MATH_HIDDEN
111  #endif
112  #endif
113 
114  #if defined _WIN32 || defined __CYGWIN__
115  #ifdef BUILDING_DLL_GZ_TRANSPORT
116  #ifdef __GNUC__
117  #define GZ_TRANSPORT_VISIBLE __attribute__ ((dllexport))
118  #else
119  #define GZ_TRANSPORT_VISIBLE __declspec(dllexport)
120  #endif
121  #else
122  #ifdef __GNUC__
123  #define GZ_TRANSPORT_VISIBLE __attribute__ ((dllimport))
124  #else
125  #define GZ_TRANSPORT_VISIBLE __declspec(dllimport)
126  #endif
127  #endif
128  #define GZ_TRANSPORT_HIDDEN
129  #else
130  #if __GNUC__ >= 4
131  #define GZ_TRANSPORT_VISIBLE __attribute__ ((visibility ("default")))
132  #define GZ_TRANSPORT_HIDDEN __attribute__ ((visibility ("hidden")))
133  #else
134  #define GZ_TRANSPORT_VISIBLE
135  #define GZ_TRANSPORT_HIDDEN
136  #endif
137  #endif
138 
139  #if defined _WIN32 || defined __CYGWIN__
140  #ifdef BUILDING_DLL_GZ_MSGS
141  #ifdef __GNUC__
142  #define GZ_MSGS_VISIBLE __attribute__ ((dllexport))
143  #else
144  #define GZ_MSGS_VISIBLE __declspec(dllexport)
145  #endif
146  #else
147  #ifdef __GNUC__
148  #define GZ_MSGS_VISIBLE __attribute__ ((dllimport))
149  #else
150  #define GZ_MSGS_VISIBLE __declspec(dllimport)
151  #endif
152  #endif
153  #define GZ_MSGS_HIDDEN
154  #else
155  #if __GNUC__ >= 4
156  #define GZ_MSGS_VISIBLE __attribute__ ((visibility ("default")))
157  #define GZ_MSGS_HIDDEN __attribute__ ((visibility ("hidden")))
158  #else
159  #define GZ_MSGS_VISIBLE
160  #define GZ_MSGS_HIDDEN
161  #endif
162  #endif
163 
164  #if defined _WIN32 || defined __CYGWIN__
165  #ifdef BUILDING_DLL_GZ_RENDERING
166  #ifdef __GNUC__
167  #define GZ_RENDERING_VISIBLE __attribute__ ((dllexport))
168  #else
169  #define GZ_RENDERING_VISIBLE __declspec(dllexport)
170  #endif
171  #else
172  #ifdef __GNUC__
173  #define GZ_RENDERING_VISIBLE __attribute__ ((dllimport))
174  #else
175  #define GZ_RENDERING_VISIBLE __declspec(dllimport)
176  #endif
177  #endif
178  #define GZ_RENDERING_HIDDEN
179  #else
180  #if __GNUC__ >= 4
181  #define GZ_RENDERING_VISIBLE __attribute__ ((visibility ("default")))
182  #define GZ_RENDERING_HIDDEN __attribute__ ((visibility ("hidden")))
183  #else
184  #define GZ_RENDERING_VISIBLE
185  #define GZ_RENDERING_HIDDEN
186  #endif
187  #endif
188 
189  #if defined _WIN32 || defined __CYGWIN__
190  #ifdef BUILDING_DLL_GZ_UTIL
191  #ifdef __GNUC__
192  #define GZ_UTIL_VISIBLE __attribute__ ((dllexport))
193  #else
194  #define GZ_UTIL_VISIBLE __declspec(dllexport)
195  #endif
196  #else
197  #ifdef __GNUC__
198  #define GZ_UTIL_VISIBLE __attribute__ ((dllimport))
199  #else
200  #define GZ_UTIL_VISIBLE __declspec(dllimport)
201  #endif
202  #endif
203  #define GZ_UTIL_HIDDEN
204  #else
205  #if __GNUC__ >= 4
206  #define GZ_UTIL_VISIBLE __attribute__ ((visibility ("default")))
207  #define GZ_UTIL_HIDDEN __attribute__ ((visibility ("hidden")))
208  #else
209  #define GZ_UTIL_VISIBLE
210  #define GZ_UTIL_HIDDEN
211  #endif
212  #endif
213 
214  #if defined _WIN32 || defined __CYGWIN__
215  #ifdef BUILDING_DLL_GZ_PHYSICS
216  #ifdef __GNUC__
217  #define GZ_PHYSICS_VISIBLE __attribute__ ((dllexport))
218  #else
219  #define GZ_PHYSICS_VISIBLE __declspec(dllexport)
220  #endif
221  #else
222  #ifdef __GNUC__
223  #define GZ_PHYSICS_VISIBLE __attribute__ ((dllimport))
224  #else
225  #define GZ_PHYSICS_VISIBLE __declspec(dllimport)
226  #endif
227  #endif
228  #define GZ_PHYSICS_HIDDEN
229  #else
230  #if __GNUC__ >= 4
231  #define GZ_PHYSICS_VISIBLE __attribute__ ((visibility ("default")))
232  #define GZ_PHYSICS_HIDDEN __attribute__ ((visibility ("hidden")))
233  #else
234  #define GZ_PHYSICS_VISIBLE
235  #define GZ_PHYSICS_HIDDEN
236  #endif
237  #endif
238 
239  #if defined _WIN32 || defined __CYGWIN__
240  #ifdef BUILDING_DLL_GZ_GUI
241  #ifdef __GNUC__
242  #define GZ_GUI_VISIBLE __attribute__ ((dllexport))
243  #else
244  #define GZ_GUI_VISIBLE __declspec(dllexport)
245  #endif
246  #else
247  #ifdef __GNUC__
248  #define GZ_GUI_VISIBLE __attribute__ ((dllimport))
249  #else
250  #define GZ_GUI_VISIBLE __declspec(dllimport)
251  #endif
252  #endif
253  #define GZ_GUI_HIDDEN
254  #else
255  #if __GNUC__ >= 4
256  #define GZ_GUI_VISIBLE __attribute__ ((visibility ("default")))
257  #define GZ_GUI_HIDDEN __attribute__ ((visibility ("hidden")))
258  #else
259  #define GZ_GUI_VISIBLE
260  #define GZ_GUI_HIDDEN
261  #endif
262  #endif
263 
264  #if defined _WIN32 || defined __CYGWIN__
265  #ifdef BUILDING_DLL_GZ_SENSORS
266  #ifdef __GNUC__
267  #define GZ_SENSORS_VISIBLE __attribute__ ((dllexport))
268  #else
269  #define GZ_SENSORS_VISIBLE __declspec(dllexport)
270  #endif
271  #else
272  #ifdef __GNUC__
273  #define GZ_SENSORS_VISIBLE __attribute__ ((dllimport))
274  #else
275  #define GZ_SENSORS_VISIBLE __declspec(dllimport)
276  #endif
277  #endif
278  #define GZ_SENSORS_HIDDEN
279  #else
280  #if __GNUC__ >= 4
281  #define GZ_SENSORS_VISIBLE __attribute__ ((visibility ("default")))
282  #define GZ_SENSORS_HIDDEN __attribute__ ((visibility ("hidden")))
283  #else
284  #define GZ_SENSORS_VISIBLE
285  #define GZ_SENSORS_HIDDEN
286  #endif
287  #endif
288 
289 // BUILDING_STATIC_LIBS
290 #endif
291 
292 // Plugins are always visible
293 #if defined _WIN32 || defined __CYGWIN__
294  #ifdef __GNUC__
295  #define GZ_PLUGIN_VISIBLE __attribute__ ((dllexport))
296  #else
297  #define GZ_PLUGIN_VISIBLE __declspec(dllexport)
298  #endif
299  #define GZ_PLUGIN_HIDDEN
300 #else
301  #if __GNUC__ >= 4
302  #define GZ_PLUGIN_VISIBLE __attribute__ ((visibility ("default")))
303  #define GZ_PLUGIN_HIDDEN __attribute__ ((visibility ("hidden")))
304  #else
305  #define GZ_PLUGIN_VISIBLE
306  #define GZ_PLUGIN_HIDDEN
307  #endif
308 #endif
309 
310 
311 // _GAZEBO_VISIBLE_HH_
312 #endif
313 
315 // Macros
317 
318 #if defined(__GNUC__)
319 #define GAZEBO_DEPRECATED(version) __attribute__((deprecated))
320 #define GAZEBO_FORCEINLINE __attribute__((always_inline))
321 #elif defined(_WIN32)
322 // GAZEBO_DEPRECATED should be defined as something like
323 // __declspec(deprecated), but it needs to go *before* the function name,
324 // and we're putting GAZEBO_DEPRECATED *after* the function.
325 #define GAZEBO_DEPRECATED(version)
326 #define GAZEBO_FORCEINLINE __forceinline
327 #else
328 #define GAZEBO_DEPRECATED(version) ()
329 #define GAZEBO_FORCEINLINE
330 #endif