[Pcsclite-cvs-commit] r5505 - in /trunk/PCSC/src/PCSC: pcsclite.h.in wintypes.h

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Jan 14 08:24:02 UTC 2011


Author: rousseau
Date: Fri Jan 14 08:23:58 2011
New Revision: 5505

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5505
Log:
Mac OS X "port"
- Define Windows types as they are defined on Mac OS X in
  /System/Library/Frameworks/PCSC.framework/Headers/wintypes.h
- Pack structures as they are packed on Mac OS X in
  /System/Library/Frameworks/PCSC.framework/Headers/pcsclite.h

With these changes it is possible to build this pcsc-lite on Mac OS X
and use it with an application built using the PCSC Framework headers
provided by Apple.

One application is to temporarily replace the Apple PCSC layer by a
better/working one.

Modified:
    trunk/PCSC/src/PCSC/pcsclite.h.in
    trunk/PCSC/src/PCSC/wintypes.h

Modified: trunk/PCSC/src/PCSC/pcsclite.h.in
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/PCSC/pcsclite.h.in?rev=5505&op=diff
==============================================================================
--- trunk/PCSC/src/PCSC/pcsclite.h.in (original)
+++ trunk/PCSC/src/PCSC/pcsclite.h.in Fri Jan 14 08:23:58 2011
@@ -37,6 +37,12 @@
 
 #define MAX_ATR_SIZE			33	/**< Maximum ATR size */
 
+/* Set structure elements aligment on bytes
+ * http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html */
+#ifdef __APPLE__
+#pragma pack(1)
+#endif
+
 typedef struct
 {
 	const char *szReader;
@@ -59,6 +65,11 @@
 typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST;
 
 extern SCARD_IO_REQUEST g_rgSCardT0Pci, g_rgSCardT1Pci, g_rgSCardRawPci;
+
+/* restore default structure elements alignment */
+#ifdef __APPLE__
+#pragma pack()
+#endif
 
 #define SCARD_PCI_T0	(&g_rgSCardT0Pci) /**< protocol control information (PCI) for T=0 */
 #define SCARD_PCI_T1	(&g_rgSCardT1Pci) /**< protocol control information (PCI) for T=1 */

Modified: trunk/PCSC/src/PCSC/wintypes.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/PCSC/wintypes.h?rev=5505&op=diff
==============================================================================
--- trunk/PCSC/src/PCSC/wintypes.h (original)
+++ trunk/PCSC/src/PCSC/wintypes.h Fri Jan 14 08:23:58 2011
@@ -21,6 +21,37 @@
 extern "C"
 {
 #endif
+
+#ifdef __APPLE__
+
+#include <stdint.h>
+
+#ifndef BYTE
+    typedef uint8_t BYTE;
+#endif
+    typedef uint8_t UCHAR;
+    typedef uint8_t *PUCHAR;
+    typedef uint16_t USHORT;
+
+#ifndef __COREFOUNDATION_CFPLUGINCOM__
+    typedef uint32_t ULONG;
+    typedef void *LPVOID;
+    typedef int16_t BOOL;
+#endif
+
+    typedef uint32_t *PULONG;
+    typedef const void *LPCVOID;
+    typedef uint32_t DWORD;
+    typedef uint32_t *PDWORD;
+    typedef uint16_t WORD;
+    typedef int32_t LONG;
+    typedef const char *LPCSTR;
+    typedef const BYTE *LPCBYTE;
+    typedef BYTE *LPBYTE;
+    typedef DWORD *LPDWORD;
+    typedef char *LPSTR;
+
+#else
 
 #ifndef BYTE
 	typedef unsigned char BYTE;
@@ -54,6 +85,8 @@
 	typedef unsigned short WORD;
 	typedef unsigned long *PULONG;
 
+#endif
+
 #ifdef __cplusplus
 }
 #endif




More information about the Pcsclite-cvs-commit mailing list