[Pcsclite-cvs-commit] r1878 - in trunk/PCSC: libmusclecard/src src

Ludovic Rousseau rousseau at costa.debian.org
Wed Feb 22 09:03:28 UTC 2006


Author: rousseau
Date: 2006-02-22 09:03:27 +0000 (Wed, 22 Feb 2006)
New Revision: 1878

Modified:
   trunk/PCSC/libmusclecard/src/musclecard.c
   trunk/PCSC/src/misc.h
Log:
We can't use a # inside a #define so it is not possible to use 
#define CONSTRUCTOR_DECLARATION(x) #pragma init (x)

The #pragma is used directly where needed


Modified: trunk/PCSC/libmusclecard/src/musclecard.c
===================================================================
--- trunk/PCSC/libmusclecard/src/musclecard.c	2006-02-22 08:16:46 UTC (rev 1877)
+++ trunk/PCSC/libmusclecard/src/musclecard.c	2006-02-22 09:03:27 UTC (rev 1878)
@@ -66,12 +66,17 @@
 
 /* Library constructor and deconstructor function for UNIX */
 #ifndef WIN32
-CONSTRUCTOR_DECLARATION(musclecard_init)
+
+/* SUN C compiler */
+#ifdef __SUNPRO_C
+#pragma init (musclecard_init)
+#pragma fini (musclecard_init)
+#endif
+
 void CONSTRUCTOR musclecard_init(void)
 {
 }
-	
-DESTRUCTOR_DECLARATION(musclecard_fini)
+
 void DESTRUCTOR musclecard_fini(void)
 {
 	if (localHContext != 0)

Modified: trunk/PCSC/src/misc.h
===================================================================
--- trunk/PCSC/src/misc.h	2006-02-22 08:16:46 UTC (rev 1877)
+++ trunk/PCSC/src/misc.h	2006-02-22 09:03:27 UTC (rev 1878)
@@ -41,24 +41,17 @@
 /* GNU Compiler Collection (GCC) */
 #define CONSTRUCTOR __attribute__ ((constructor))
 #define DESTRUCTOR __attribute__ ((destructor))
-#define CONSTRUCTOR_DECLARATION(x)
-#define DESTRUCTOR_DECLARATION(x)
 	
-#elif defined __SUNPRO_C
-
-/* SUN C compiler */
-#define CONSTRUCTOR
-#define DESTRUCTOR
-#define CONSTRUCTOR_DECLARATION(x) #pragma init (x)
-#define DESTRUCTOR_DECLARATION(x) #pragma fini (x)
-	
 #else
 
+/* SUN C compiler does not use __attribute__ but #pragma init (function)
+ * We can't use a # inside a #define so it is not possible to use 
+ * #define CONSTRUCTOR_DECLARATION(x) #pragma init (x)
+ * The #pragma is used directly where needed */
+
 /* any other */
 #define CONSTRUCTOR
 #define DESTRUCTOR
-#define CONSTRUCTOR_DECLARATION(x)
-#define DESTRUCTOR_DECLARATION(x)
 
 #endif
 




More information about the Pcsclite-cvs-commit mailing list