[Pcsclite-cvs-commit] r6198 - /trunk/PCSC/src/spy/libpcscspy.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Jan 24 14:37:15 UTC 2012
Author: rousseau
Date: Tue Jan 24 14:37:14 2012
New Revision: 6198
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6198
Log:
Add Mac OS X support
Modified:
trunk/PCSC/src/spy/libpcscspy.c
Modified: trunk/PCSC/src/spy/libpcscspy.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/spy/libpcscspy.c?rev=6198&op=diff
==============================================================================
--- trunk/PCSC/src/spy/libpcscspy.c (original)
+++ trunk/PCSC/src/spy/libpcscspy.c Tue Jan 24 14:37:14 2012
@@ -322,8 +322,19 @@
static LONG load_lib(void)
{
+#ifdef __APPLE__
+/* We should be able to directly use this
+ * #define LIBPCSC_NOSPY "/System/Library/Frameworks/PCSC.framework/PCSC"
+ * but for a yet unknown reason the dlsym() returns symbols from the spy
+ * library and not from the framework.
+ * Just copying the framework in /tmp does solve the problem.
+ */
+#define LIBPCSC_NOSPY "/tmp/PCSC"
+#define LIBPCSC "/tmp/PCSC"
+#else
#define LIBPCSC_NOSPY "libpcsclite_nospy.so.1"
#define LIBPCSC "libpcsclite.so.1"
+#endif
/* first try to load the NOSPY library
* this is used for programs doing an explicit dlopen like
@@ -364,7 +375,9 @@
get_symbol(SCardTransmit);
get_symbol(SCardListReaderGroups);
get_symbol(SCardListReaders);
- get_symbol(SCardFreeMemory);
+ /* Mac OS X do not have SCardFreeMemory() */
+ if (dlsym(Lib_handle, "SCardFreeMemory"))
+ get_symbol(SCardFreeMemory);
get_symbol(SCardCancel);
get_symbol(SCardGetAttrib);
get_symbol(SCardSetAttrib);
More information about the Pcsclite-cvs-commit
mailing list