globalplatform/library.h

Go to the documentation of this file.
00001 /*  Copyright (c) 2008, Karsten Ohme
00002  *  This file is part of GlobalPlatform.
00003  *
00004  *  GlobalPlatform is free software: you can redistribute it and/or modify
00005  *  it under the terms of the GNU Lesser General Public License as published by
00006  *  the Free Software Foundation, either version 3 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  GlobalPlatform is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Lesser General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Lesser General Public License
00015  *  along with GlobalPlatform.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00022 #ifndef OPGP_LIBRARY_H
00023 #define OPGP_LIBRARY_H
00024 
00025 // dynamic library
00026 #if (defined(WIN32) || defined __CYGWIN__)
00027         #ifdef OPGP_EXPORTS
00028                 #ifdef __GNUC__
00029                   #define OPGP_API __attribute__((dllexport))
00030                 #else
00031                   #define OPGP_API __declspec(dllexport)
00032                 #endif
00033         #else
00034                 #ifdef __GNUC__
00035                   #define OPGP_API __attribute__((dllimport))
00036                 #else
00037                   #define OPGP_API __declspec(dllimport)
00038                 #endif
00039         #endif
00040         #define OPGP_NO_API
00041 #else
00042         #if defined __GNUC__ && (__GNUC__ >= 4)
00043                 #define OPGP_API __attribute__ ((visibility("default")))
00044                 #define OPGP_NO_API __attribute__ ((visibility("hidden")))
00045         #else
00046                 #define OPGP_API
00047                 #define OPGP_NO_API
00048         #endif
00049 #endif // #if (defined(WIN32) || defined __CYGWIN__)
00050 
00051 // for plugin libhraries
00052 #if (defined(WIN32) || defined __CYGWIN__)
00053         #ifdef OPGP_PL_EXPORTS
00054                 #ifdef __GNUC__
00055                   #define OPGP_PL_API __attribute__((dllexport))
00056                 #else
00057                   #define OPGP_PL_API __declspec(dllexport)
00058                 #endif
00059         #else
00060                 #ifdef __GNUC__
00061                   #define OPGP_PL_API __attribute__((dllimport))
00062                 #else
00063                   #define OPGP_PL_API __declspec(dllimport)
00064                 #endif
00065         #endif
00066 #else
00067         #if defined __GNUC__ && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
00068                 #define OPGP_PL_API __attribute__ ((visibility("default")))
00069         #else
00070                 #define OPGP_PL_API
00071         #endif
00072 #endif // #if (defined(WIN32) || defined __CYGWIN__)
00073 
00074 
00075 #if defined __GNUC__
00076 
00077 /* GNU Compiler Collection (GCC) */
00078 #define CONSTRUCTOR __attribute__ ((constructor))
00079 #define DESTRUCTOR __attribute__ ((destructor))
00080 
00081 #else
00082 
00083 /* SUN C compiler does not use __attribute__ but #pragma init (function)
00084  * We can't use a # inside a #define so it is not possible to use
00085  * #define CONSTRUCTOR_DECLARATION(x) #pragma init (x)
00086  * The #pragma is used directly where needed */
00087 
00088 /* any other */
00089 #define CONSTRUCTOR
00090 #define DESTRUCTOR
00091 
00092 #endif
00093 
00094 #endif
00095 
00096 
00097 
00098 
00099 
00100 
Generated on Wed Aug 11 00:24:28 2010 for GlobalPlatformLibrary by  doxygen 1.6.3