HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
H5api_adpt.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the files COPYING and Copyright.html. COPYING can be found at the root *
9  * of the source code distribution tree; Copyright.html can be found at the *
10  * root level of an installed copy of the electronic HDF5 document set and *
11  * is linked from the top-level documents page. It can also be found at *
12  * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
13  * access to either file, you may request a copy from help@hdfgroup.org. *
14  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /*
17  * H5api_adpt.h
18  * Used for the HDF5 dll project
19  * Created by Patrick Lu on 1/12/99
20  */
21 #ifndef H5API_ADPT_H
22 #define H5API_ADPT_H
23 
24 /* This will only be defined if HDF5 was built with CMake */
25 #ifdef H5_BUILT_AS_DYNAMIC_LIB
26 
27 #if defined (hdf5_EXPORTS)
28  #define _HDF5DLL_
29 #else
30  #define _HDF5USEDLL_
31 #endif
32 
33 #if defined (hdf5_test_EXPORTS)
34  #define _HDF5TESTDLL_
35 #else
36  #define _HDF5TESTUSEDLL_
37 #endif
38 
39 #if defined (hdf5_tools_EXPORTS)
40  #define _HDF5TOOLSDLL_
41 #else
42  #define _HDF5TOOLSUSEDLL_
43 #endif
44 
45 #if defined (hdf5_cpp_EXPORTS)
46  #define HDF5_CPPDLL_EXPORTS
47 #else
48  #define HDF5CPP_USEDLL
49 #endif
50 
51 #if defined (hdf5_hl_EXPORTS)
52  #define _HDF5_HLDLL_EXPORTS_
53 #else
54  #define _HDF5USEHLDLL_
55 #endif
56 
57 #if defined (hdf5_hl_cpp_EXPORTS)
58  #define HDF5_HL_CPPDLL_EXPORTS
59 #else
60  #define HDF5USE_HLCPPDLL
61 #endif
62 
63 #if defined (hdf5_f90cstub_EXPORTS)
64  #define HDF5FORT_CSTUB_DLL_EXPORTS
65 #else
66  #define HDF5FORT_CSTUB_USEDLL
67 #endif
68 
69 #if defined (hdf5_test_f90cstub_EXPORTS)
70  #define HDF5FORTTEST_CSTUB_DLL_EXPORTS
71 #endif
72 
73 #if defined (hdf5_hl_f90cstub_EXPORTS)
74  #define HDF5_HL_F90CSTUBDLL_EXPORTS
75 #endif
76 
77 #if defined(hdf5_EXPORTS)
78  #if defined (_MSC_VER) /* MSVC Compiler Case */
79  #define H5_DLL __declspec(dllexport)
80  #define H5_DLLVAR extern __declspec(dllexport)
81  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
82  #define H5_DLL __attribute__ ((visibility("default")))
83  #define H5_DLLVAR extern __attribute__ ((visibility("default")))
84  #endif
85 #else
86  #if defined (_MSC_VER) /* MSVC Compiler Case */
87  #define H5_DLL __declspec(dllimport)
88  #define H5_DLLVAR __declspec(dllimport)
89  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
90  #define H5_DLL __attribute__ ((visibility("default")))
91  #define H5_DLLVAR extern __attribute__ ((visibility("default")))
92  #endif
93 #endif
94 
95 #ifndef H5_DLL
96  #define H5_DLL
97  #define H5_DLLVAR extern
98 #endif /* _HDF5DLL_ */
99 
100 #if defined(hdf5_test_EXPORTS)
101  #if defined (_MSC_VER) /* MSVC Compiler Case */
102  #define H5TEST_DLL __declspec(dllexport)
103  #define H5TEST_DLLVAR extern __declspec(dllexport)
104  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
105  #define H5TEST_DLL __attribute__ ((visibility("default")))
106  #define H5TEST_DLLVAR extern __attribute__ ((visibility("default")))
107  #endif
108 #else
109  #if defined (_MSC_VER) /* MSVC Compiler Case */
110  #define H5TEST_DLL __declspec(dllimport)
111  #define H5TEST_DLLVAR __declspec(dllimport)
112  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
113  #define H5TEST_DLL __attribute__ ((visibility("default")))
114  #define H5TEST_DLLVAR extern __attribute__ ((visibility("default")))
115  #endif
116 #endif
117 
118 #ifndef H5TEST_DLL
119  #define H5TEST_DLL
120  #define H5TEST_DLLVAR extern
121 #endif /* H5TEST_DLL */
122 
123 #if defined(hdf5_tools_EXPORTS)
124  #if defined (_MSC_VER) /* MSVC Compiler Case */
125  #define H5TOOLS_DLL __declspec(dllexport)
126  #define H5TOOLS_DLLVAR extern __declspec(dllexport)
127  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
128  #define H5TOOLS_DLL __attribute__ ((visibility("default")))
129  #define H5TOOLS_DLLVAR extern __attribute__ ((visibility("default")))
130  #endif
131 #else
132  #if defined (_MSC_VER) /* MSVC Compiler Case */
133  #define H5TOOLS_DLL __declspec(dllimport)
134  #define H5TOOLS_DLLVAR __declspec(dllimport)
135  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
136  #define H5TOOLS_DLL __attribute__ ((visibility("default")))
137  #define H5TOOLS_DLLVAR extern __attribute__ ((visibility("default")))
138  #endif
139 #endif
140 
141 #ifndef H5TOOLS_DLL
142  #define H5TOOLS_DLL
143  #define H5TOOLS_DLLVAR extern
144 #endif /* H5TOOLS_DLL */
145 
146 #if defined(hdf5_cpp_EXPORTS)
147  #if defined (_MSC_VER) /* MSVC Compiler Case */
148  #define H5_DLLCPP __declspec(dllexport)
149  #define H5_DLLCPPVAR extern __declspec(dllexport)
150  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
151  #define H5_DLLCPP __attribute__ ((visibility("default")))
152  #define H5_DLLCPPVAR extern __attribute__ ((visibility("default")))
153  #endif
154 #else
155  #if defined (_MSC_VER) /* MSVC Compiler Case */
156  #define H5_DLLCPP __declspec(dllimport)
157  #define H5_DLLCPPVAR __declspec(dllimport)
158  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
159  #define H5_DLLCPP __attribute__ ((visibility("default")))
160  #define H5_DLLCPPVAR extern __attribute__ ((visibility("default")))
161  #endif
162 #endif
163 
164 #ifndef H5_DLLCPP
165  #define H5_DLLCPP
166  #define H5_DLLCPPVAR extern
167 #endif /* H5_DLLCPP */
168 
169 #if defined(hdf5_hl_EXPORTS)
170  #if defined (_MSC_VER) /* MSVC Compiler Case */
171  #define H5_HLDLL __declspec(dllexport)
172  #define H5_HLDLLVAR extern __declspec(dllexport)
173  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
174  #define H5_HLDLL __attribute__ ((visibility("default")))
175  #define H5_HLDLLVAR extern __attribute__ ((visibility("default")))
176  #endif
177 #else
178  #if defined (_MSC_VER) /* MSVC Compiler Case */
179  #define H5_HLDLL __declspec(dllimport)
180  #define H5_HLDLLVAR __declspec(dllimport)
181  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
182  #define H5_HLDLL __attribute__ ((visibility("default")))
183  #define H5_HLDLLVAR extern __attribute__ ((visibility("default")))
184  #endif
185 #endif
186 
187 #ifndef H5_HLDLL
188  #define H5_HLDLL
189  #define H5_HLDLLVAR extern
190 #endif /* H5_HLDLL */
191 
192 #if defined(hdf5_hl_cpp_EXPORTS)
193  #if defined (_MSC_VER) /* MSVC Compiler Case */
194  #define H5_HLCPPDLL __declspec(dllexport)
195  #define H5_HLCPPDLLVAR extern __declspec(dllexport)
196  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
197  #define H5_HLCPPDLL __attribute__ ((visibility("default")))
198  #define H5_HLCPPDLLVAR extern __attribute__ ((visibility("default")))
199  #endif
200 #else
201  #if defined (_MSC_VER) /* MSVC Compiler Case */
202  #define H5_HLCPPDLL __declspec(dllimport)
203  #define H5_HLCPPDLLVAR __declspec(dllimport)
204  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
205  #define H5_HLCPPDLL __attribute__ ((visibility("default")))
206  #define H5_HLCPPDLLVAR extern __attribute__ ((visibility("default")))
207  #endif
208 #endif
209 
210 #ifndef H5_HLCPPDLL
211  #define H5_HLCPPDLL
212  #define H5_HLCPPDLLVAR extern
213 #endif /* H5_HLCPPDLL */
214 
215 #if defined(hdf5_f90cstub_EXPORTS)
216  #if defined (_MSC_VER) /* MSVC Compiler Case */
217  #define H5_FCDLL __declspec(dllexport)
218  #define H5_FCDLLVAR extern __declspec(dllexport)
219  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
220  #define H5_FCDLL __attribute__ ((visibility("default")))
221  #define H5_FCDLLVAR extern __attribute__ ((visibility("default")))
222  #endif
223 #else
224  #if defined (_MSC_VER) /* MSVC Compiler Case */
225  #define H5_FCDLL __declspec(dllimport)
226  #define H5_FCDLLVAR __declspec(dllimport)
227  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
228  #define H5_FCDLL __attribute__ ((visibility("default")))
229  #define H5_FCDLLVAR extern __attribute__ ((visibility("default")))
230  #endif
231 #endif
232 
233 #ifndef H5_FCDLL
234  #define H5_FCDLL
235  #define H5_FCDLLVAR extern
236 #endif /* H5_FCDLL */
237 
238 #if defined(hdf5_test_f90cstub_EXPORTS)
239  #if defined (_MSC_VER) /* MSVC Compiler Case */
240  #define H5_FCTESTDLL __declspec(dllexport)
241  #define H5_FCTESTDLLVAR extern __declspec(dllexport)
242  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
243  #define H5_FCTESTDLL __attribute__ ((visibility("default")))
244  #define H5_FCTESTDLLVAR extern __attribute__ ((visibility("default")))
245  #endif
246 #else
247  #if defined (_MSC_VER) /* MSVC Compiler Case */
248  #define H5_FCTESTDLL __declspec(dllimport)
249  #define H5_FCTESTDLLVAR __declspec(dllimport)
250  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
251  #define H5_FCTESTDLL __attribute__ ((visibility("default")))
252  #define H5_FCTESTDLLVAR extern __attribute__ ((visibility("default")))
253  #endif
254 #endif
255 
256 #ifndef H5_FCTESTDLL
257  #define H5_FCTESTDLL
258  #define H5_FCTESTDLLVAR extern
259 #endif /* H5_FCTESTDLL */
260 
261 #if defined(hdf5_hl_f90cstub_EXPORTS)
262  #if defined (_MSC_VER) /* MSVC Compiler Case */
263  #define HDF5_HL_F90CSTUBDLL __declspec(dllexport)
264  #define HDF5_HL_F90CSTUBDLLVAR extern __declspec(dllexport)
265  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
266  #define HDF5_HL_F90CSTUBDLL __attribute__ ((visibility("default")))
267  #define HDF5_HL_F90CSTUBDLLVAR extern __attribute__ ((visibility("default")))
268  #endif
269 #else
270  #if defined (_MSC_VER) /* MSVC Compiler Case */
271  #define HDF5_HL_F90CSTUBDLL __declspec(dllimport)
272  #define HDF5_HL_F90CSTUBDLLVAR __declspec(dllimport)
273  #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */
274  #define HDF5_HL_F90CSTUBDLL __attribute__ ((visibility("default")))
275  #define HDF5_HL_F90CSTUBDLLVAR extern __attribute__ ((visibility("default")))
276  #endif
277 #endif
278 
279 #ifndef HDF5_HL_F90CSTUBDLL
280  #define HDF5_HL_F90CSTUBDLL
281  #define HDF5_HL_F90CSTUBDLLVAR extern
282 #endif /* HDF5_HL_F90CSTUBDLL */
283 
284 #elif defined(H5_BUILT_AS_STATIC_LIB)
285  #define H5_DLL
286  #define H5_HLDLL
287  #define H5_HLCPPDLL
288  #define HDF5_HL_F90CSTUBDLL
289  #define H5_DLLVAR extern
290  #define H5_DLLCPP
291  #define H5TEST_DLL
292  #define H5TEST_DLLVAR extern
293  #define H5TOOLS_DLL
294  #define H5TOOLS_DLLVAR extern
295  #define H5_FCDLL
296  #define H5_FCDLLVAR extern
297  #define H5_FCTESTDLL
298  #define H5_FCTESTDLLVAR extern
299 
300 #else
301 /* This is the original HDFGroup defined preprocessor code which should still work
302  * with the VS projects that are maintained by "The HDF Group"
303  * The Visual Studio project files will not be supported in the next major release of 1.10.
304  */
305 
306 #if defined(H5_HAVE_WIN32_API)
307 
308 #if defined(_HDF5DLL_)
309 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
310 #define H5_DLL __declspec(dllexport)
311 #define H5_DLLVAR extern __declspec(dllexport)
312 #elif defined(_HDF5USEDLL_)
313 #define H5_DLL __declspec(dllimport)
314 #define H5_DLLVAR __declspec(dllimport)
315 #else
316 #define H5_DLL
317 #define H5_DLLVAR extern
318 #endif /* _HDF5DLL_ */
319 
320 #if defined(_HDF5TESTDLL_)
321 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
322 #define H5TEST_DLL __declspec(dllexport)
323 #define H5TEST_DLLVAR extern __declspec(dllexport)
324 #elif defined(_HDF5TESTUSEDLL_)
325 #define H5TEST_DLL __declspec(dllimport)
326 #define H5TEST_DLLVAR __declspec(dllimport)
327 #else
328 #define H5TEST_DLL
329 #define H5TEST_DLLVAR extern
330 #endif /* _HDF5TESTDLL_ */
331 
332 #if defined(_HDF5TOOLSDLL_)
333 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
334 #define H5TOOLS_DLL __declspec(dllexport)
335 #define H5TOOLS_DLLVAR extern __declspec(dllexport)
336 #elif defined(_HDF5TOOLSUSEDLL_)
337 #define H5TOOLS_DLL __declspec(dllimport)
338 #define H5TOOLS_DLLVAR __declspec(dllimport)
339 #else
340 #define H5TOOLS_DLL
341 #define H5TOOLS_DLLVAR extern
342 #endif /* _HDF5TOOLSDLL_ */
343 
344 #if defined(_HDF5_HLDLL_EXPORTS_)
345 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
346 #define H5_HLDLL __declspec(dllexport)
347 #elif defined(_HDF5USEHLDLL_)
348 #define H5_HLDLL __declspec(dllimport)
349 #else
350 #define H5_HLDLL
351 #endif /* _HDF5_HLDLL_EXPORTS */
352 
353 #if defined(HDF5_HL_CPPDLL_EXPORTS)
354 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
355 #define H5_HLCPPDLL __declspec(dllexport)
356 #elif defined(HDF5USE_HLCPPDLL)
357 #define H5_HLCPPDLL __declspec(dllimport)
358 #else
359 #define H5_HLCPPDLL
360 #endif /*HDF5_HL_CPPDLL_EXPORTS*/
361 
362 #if defined(HDF5_HL_F90CSTUBDLL_EXPORTS)
363 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
364 #define HDF5_HL_F90CSTUBDLL __declspec(dllexport)
365 #elif defined(HDF5USE_HLF90CSTUBDLL)
366 #define HDF5_HL_F90CSTUBDLL __declspec(dllimport)
367 #else
368 #define HDF5_HL_F90CSTUBDLL
369 #endif /*HDF5_HL_F90CSTUBDLL_EXPORTS*/
370 
371 
372 #if defined(HDF5FORT_CSTUB_DLL_EXPORTS)
373 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
374 #define H5_FCDLL __declspec(dllexport)
375 #define H5_FCDLLVAR extern __declspec(dllexport)
376 #elif defined(HDF5FORT_CSTUB_USEDLL)
377 #define H5_FCDLL __declspec(dllimport)
378 #define H5_FCDLLVAR __declspec(dllimport)
379 #else
380 #define H5_FCDLL
381 #define H5_FCDLLVAR extern
382 #endif /* _HDF5_FORTRANDLL_EXPORTS_ */
383 
384 #if defined(HDF5FORTTEST_CSTUB_DLL_EXPORTS)
385 #pragma warning(disable: 4273) /* Disable the dll linkage warnings */
386 #define H5_FCTESTDLL __declspec(dllexport)
387 #define H5_FCTESTDLLVAR extern __declspec(dllexport)
388 #elif defined(HDF5FORTTEST_CSTUB_USEDLL)
389 #define H5_FCTESTDLL __declspec(dllimport)
390 #define H5_FCTESTDLLVAR __declspec(dllimport)
391 #else
392 #define H5_FCTESTDLL
393 #define H5_FCTESTDLLVAR extern
394 #endif /* _HDF5_FORTRANDLL_EXPORTS_ */
395 
396 /* Added to export or to import C++ APIs - BMR (02-15-2002) */
397 #if defined(HDF5_CPPDLL_EXPORTS) /* this name is generated at creation */
398 #define H5_DLLCPP __declspec(dllexport)
399 #elif defined(HDF5CPP_USEDLL)
400 #define H5_DLLCPP __declspec(dllimport)
401 #else
402 #define H5_DLLCPP
403 #endif /* HDF5_CPPDLL_EXPORTS */
404 
405 #else /*H5_HAVE_WIN32_API*/
406 #define H5_DLL
407 #define H5_HLDLL
408 #define H5_HLCPPDLL
409 #define HDF5_HL_F90CSTUBDLL
410 #define H5_DLLVAR extern
411 #define H5_DLLCPP
412 #define H5TEST_DLL
413 #define H5TEST_DLLVAR extern
414 #define H5TOOLS_DLL
415 #define H5TOOLS_DLLVAR extern
416 #define H5_FCDLL
417 #define H5_FCDLLVAR extern
418 #define H5_FCTESTDLL
419 #define H5_FCTESTDLLVAR extern
420 #endif /*H5_HAVE_WIN32_API*/
421 
422 #endif /* H5API_ADPT_H */
423 
424 #endif /* */