pcsc-lite  1.8.14
wintypes.h
Go to the documentation of this file.
1 /*
2  * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
3  *
4  * Copyright (C) 1999
5  * David Corcoran <corcoran@musclecard.com>
6  * Copyright (C) 2002-2011
7  * Ludovic Rousseau <ludovic.rousseau@free.fr>
8  *
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions
11 are met:
12 
13 1. Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 2. Redistributions in binary form must reproduce the above copyright
16  notice, this list of conditions and the following disclaimer in the
17  documentation and/or other materials provided with the distribution.
18 3. The name of the author may not be used to endorse or promote products
19  derived from this software without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * $Id$
33  */
34 
40 #ifndef __wintypes_h__
41 #define __wintypes_h__
42 
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47 
48 #ifdef __APPLE__
49 
50 #include <stdint.h>
51 
52 #ifndef BYTE
53  typedef uint8_t BYTE;
54 #endif
55  typedef uint8_t UCHAR;
56  typedef UCHAR *PUCHAR;
57  typedef uint16_t USHORT;
58 
59 #ifndef __COREFOUNDATION_CFPLUGINCOM__
60  typedef uint32_t ULONG;
61  typedef void *LPVOID;
62  typedef int16_t BOOL;
63 #endif
64 
65  typedef ULONG *PULONG;
66  typedef const void *LPCVOID;
67  typedef uint32_t DWORD;
68  typedef DWORD *PDWORD;
69  typedef uint16_t WORD;
70  typedef int32_t LONG;
71  typedef const char *LPCSTR;
72  typedef const BYTE *LPCBYTE;
73  typedef BYTE *LPBYTE;
74  typedef DWORD *LPDWORD;
75  typedef char *LPSTR;
76 
77 #else
78 
79 #ifndef BYTE
80  typedef unsigned char BYTE;
81 #endif
82  typedef unsigned char UCHAR;
83  typedef UCHAR *PUCHAR;
84  typedef unsigned short USHORT;
85 
86 #ifndef __COREFOUNDATION_CFPLUGINCOM__
87  typedef unsigned long ULONG;
88  typedef void *LPVOID;
89 #endif
90 
91  typedef const void *LPCVOID;
92  typedef unsigned long DWORD;
93  typedef DWORD *PDWORD;
94  typedef long LONG;
95  typedef const char *LPCSTR;
96  typedef const BYTE *LPCBYTE;
97  typedef BYTE *LPBYTE;
98  typedef DWORD *LPDWORD;
99  typedef char *LPSTR;
100 
101  /* these types were deprecated but still used by old drivers and
102  * applications. So just declare and use them. */
103  typedef LPSTR LPTSTR;
104  typedef LPCSTR LPCTSTR;
105 
106  /* types unused by pcsc-lite */
107  typedef short BOOL;
108  typedef unsigned short WORD;
109  typedef ULONG *PULONG;
110 
111 #endif
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif