MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exports.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2012 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  MeteoIO is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef EXPORTS_H
20 #define EXPORTS_H
21 
22 // Generic helper definitions for shared library support
23 #if defined _WIN32 || defined __MINGW32__ || defined __CYGWIN__
24  #define MIO_HELPER_DLL_IMPORT __declspec(dllimport)
25  #define MIO_HELPER_DLL_EXPORT __declspec(dllexport)
26  #define MIO_HELPER_DLL_LOCAL
27 #else
28  #if defined __clang__ || __GNUC__ >= 4
29  #define MIO_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
30  #define MIO_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
31  #define MIO_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
32  #else
33  #define MIO_HELPER_DLL_IMPORT
34  #define MIO_HELPER_DLL_EXPORT
35  #define MIO_HELPER_DLL_LOCAL
36  #endif
37 #endif
38 
39 // Now we use the generic helper definitions above to define
40 // MIO_API (for public API symbols) and MIO_LOCAL (non-api symbols)
41 #ifdef MIO_DLL //dynamic compile
42  #ifdef MIO_DLL_EXPORTS //building as a dll
43  #define MIO_API MIO_HELPER_DLL_EXPORT
44  #else
45  #define MIO_API MIO_HELPER_DLL_IMPORT
46  #endif
47  #define MIO_LOCAL MIO_HELPER_DLL_LOCAL
48 #else //static compile
49  #define MIO_API
50  #define MIO_LOCAL
51 #endif
52 
53 #endif