globalplatform
library.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005-2026, Karsten Ohme
3  * This file is part of GlobalPlatform.
4  *
5  * GlobalPlatform 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  * GlobalPlatform 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 GlobalPlatform. If not, see <https://www.gnu.org/licenses/>.
17  *
18  * In addition, as a special exception, the copyright holders give
19  * permission to link the code of portions of this program with the
20  * OpenSSL library under certain conditions as described in each
21  * individual source file, and distribute linked combinations
22  * including the two.
23  * You must obey the GNU Lesser General Public License in all respects
24  * for all of the code used other than OpenSSL. If you modify
25  * file(s) with this exception, you may extend this exception to your
26  * version of the file(s), but you are not obligated to do so. If you
27  * do not wish to do so, delete this exception statement from your
28  * version.
29  */
30 
35 #ifndef OPGP_LIBRARY_H
36 #define OPGP_LIBRARY_H
37 
38 // dynamic library
39 #if (defined(WIN32) || defined __CYGWIN__)
40  #ifdef OPGP_STATIC
41  #define OPGP_API
42  #define OPGP_NO_API
43  #else
44  #ifdef OPGP_EXPORTS
45  #ifdef __GNUC__
46  #define OPGP_API __attribute__((dllexport))
47  #else
48  #define OPGP_API __declspec(dllexport)
49  #endif
50  #else
51  #ifdef __GNUC__
52  #define OPGP_API __attribute__((dllimport))
53  #else
54  #define OPGP_API __declspec(dllimport)
55  #endif
56  #endif
57  #define OPGP_NO_API
58  #endif
59 #else
60  #if defined __GNUC__ && (__GNUC__ >= 4)
61  #define OPGP_API __attribute__ ((visibility("default")))
62  #define OPGP_NO_API __attribute__ ((visibility("hidden")))
63  #else
64  #define OPGP_API
65  #define OPGP_NO_API
66  #endif
67 #endif // #if (defined(WIN32) || defined __CYGWIN__)
68 
69 // for plugin libhraries
70 #if (defined(WIN32) || defined __CYGWIN__)
71  #ifdef OPGP_STATIC
72  #define OPGP_PL_API
73  #else
74  #ifdef OPGP_PL_EXPORTS
75  #ifdef __GNUC__
76  #define OPGP_PL_API __attribute__((dllexport))
77  #else
78  #define OPGP_PL_API __declspec(dllexport)
79  #endif
80  #else
81  #ifdef __GNUC__
82  #define OPGP_PL_API __attribute__((dllimport))
83  #else
84  #define OPGP_PL_API __declspec(dllimport)
85  #endif
86  #endif
87  #endif
88 #else
89  #if defined __GNUC__ && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
90  #define OPGP_PL_API __attribute__ ((visibility("default")))
91  #else
92  #define OPGP_PL_API
93  #endif
94 #endif // #if (defined(WIN32) || defined __CYGWIN__)
95 
96 
97 #if defined __GNUC__
98 
99 /* GNU Compiler Collection (GCC) */
100 #define CONSTRUCTOR __attribute__ ((constructor))
101 #define DESTRUCTOR __attribute__ ((destructor))
102 
103 #else
104 
105 #define CONSTRUCTOR
106 #define DESTRUCTOR
107 
108 #endif
109 
110 #endif
111 
112 
113 
114 
115 
116