misc.h

00001 /*
00002  * This handles GCC attributes
00003  *
00004  * MUSCLE SmartCard Development ( http://www.linuxnet.com )
00005  *
00006  * Copyright (C) 2005
00007  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
00008  *
00009  * $Id: misc.h 1878 2006-02-22 09:03:27Z rousseau $
00010  */
00011 
00012 #ifndef __local_h__
00013 #define __local_h__
00014 
00015 #ifdef __cplusplus
00016 extern "C"
00017 {
00018 #endif
00019 
00020 /*
00021  * Declare the function as internal to the library: the function name is
00022  * not exported and can't be used by a program linked to the library
00023  *
00024  * see http://gcc.gnu.org/onlinedocs/gcc-3.3.5/gcc/Function-Attributes.html#Function-Attributes
00025  * see http://www.nedprod.com/programs/gccvisibility.html
00026  */
00027 #if defined __GNUC__
00028 #define INTERNAL __attribute__ ((visibility("hidden")))
00029 #define PCSC_API __attribute__ ((visibility("default")))
00030 /* http://docs.sun.com/source/817-6697/sun.specific.html#marker-998544 */
00031 #elif defined __SUNPRO_C
00032 #define INTERNAL __hidden
00033 #define PCSC_API
00034 #else
00035 #define INTERNAL
00036 #define PCSC_API
00037 #endif
00038 
00039 #if defined __GNUC__
00040 
00041 /* GNU Compiler Collection (GCC) */
00042 #define CONSTRUCTOR __attribute__ ((constructor))
00043 #define DESTRUCTOR __attribute__ ((destructor))
00044     
00045 #else
00046 
00047 /* SUN C compiler does not use __attribute__ but #pragma init (function)
00048  * We can't use a # inside a #define so it is not possible to use 
00049  * #define CONSTRUCTOR_DECLARATION(x) #pragma init (x)
00050  * The #pragma is used directly where needed */
00051 
00052 /* any other */
00053 #define CONSTRUCTOR
00054 #define DESTRUCTOR
00055 
00056 #endif
00057 
00058 #ifdef __cplusplus
00059 }
00060 #endif
00061 
00062 #endif /* __lcoal_h__ */

Generated on Fri Mar 24 04:30:05 2006 for pcsc-lite by  doxygen 1.4.6