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