4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Purpose: define basic common types and macros
31 /******* Common definitions and typedefs ***********************************/
53 //2007-0115-04<Add>by MikeLiu
59 //2007-0814-01<Add>by MikeLiu
64 //2008-0131-01<Add>by MikeLiu
69 #if! defined(__CPU8051)
91 //2007-0809-01<Add>by MikeLiu
92 #ifndef update_BssList
93 #define update_BssList
96 #ifndef WPA_SM_Transtatus
97 #define WPA_SM_Transtatus
100 #ifndef Calcu_LinkQual
101 #define Calcu_LinkQual
104 /****** Simple typedefs ***************************************************/
106 #if! defined(__CPU8051)
108 /* These lines assume that your compiler's longs are 32 bits and
109 * shorts are 16 bits. It is already assumed that chars are 8 bits,
110 * but it doesn't matter if they're signed or unsigned.
113 typedef signed char I8
; /* 8-bit signed integer */
114 typedef signed short I16
; /* 16-bit signed integer */
115 typedef signed long I32
; /* 32-bit signed integer */
117 typedef unsigned char U8
; /* 8-bit unsigned integer */
118 typedef unsigned short U16
; /* 16-bit unsigned integer */
119 typedef unsigned long U32
; /* 32-bit unsigned integer */
123 typedef signed __int64 I64
; /* 64-bit signed integer */
124 typedef unsigned __int64 U64
; /* 64-bit unsigned integer */
129 typedef signed short SHORT
;
130 typedef signed int INT
;
131 typedef signed long LONG
;
133 typedef unsigned char UCHAR
;
134 typedef unsigned short USHORT
;
135 typedef unsigned int UINT
;
136 typedef unsigned long ULONG
;
137 typedef unsigned long long ULONGLONG
; //64 bit
138 typedef unsigned long long ULONGULONG
;
142 typedef unsigned char BYTE
; // 8-bit
143 typedef unsigned short WORD
; // 16-bit
144 typedef unsigned long DWORD
; // 32-bit
146 // QWORD is for those situation that we want
147 // an 8-byte-aligned 8 byte long structure
148 // which is NOT really a floating point number.
149 typedef union tagUQuadWord
{
154 double DoNotUseThisField
;
156 typedef UQuadWord QWORD
; // 64-bit
160 #ifndef _TCHAR_DEFINED
162 typedef char* PTCHAR
;
163 typedef unsigned char TBYTE
;
164 typedef unsigned char* PTBYTE
;
165 #define _TCHAR_DEFINED
170 #define U8 unsigned char
171 #define U16 unsigned short
172 #define U32 unsigned long
174 #define USHORT unsigned short
175 #define UINT unsigned int
177 #define BYTE unsigned char
178 #define WORD unsigned short
179 #define DWORD unsigned long
185 // maybe this should be defined in <limits.h>
187 #define U16_MAX 0xFFFFU
188 #define U32_MAX 0xFFFFFFFFUL
190 #define BYTE_MAX 0xFFU
191 #define WORD_MAX 0xFFFFU
192 #define DWORD_MAX 0xFFFFFFFFUL
197 /******* 32-bit vs. 16-bit definitions and typedefs ************************/
203 #define NULL ((void *)0)
204 #endif // __cplusplus
210 #if defined(__WIN32) || defined(__CPU8051)
221 #if !defined(CALLBACK)
234 // default pointer type is FAR, if you want near pointer just redefine it to NEAR
237 #if !defined(CALLBACK)
246 /****** Common pointer types ***********************************************/
248 #if! defined(__CPU8051)
250 typedef signed char DEF
* PI8
;
251 typedef signed short DEF
* PI16
;
252 typedef signed long DEF
* PI32
;
254 typedef unsigned char DEF
* PU8
;
255 typedef unsigned short DEF
* PU16
;
256 typedef unsigned long DEF
* PU32
;
259 typedef signed __int64 DEF
* PI64
;
260 typedef unsigned __int64 DEF
* PU64
;
264 typedef unsigned long ULONG_PTR
; // 32-bit
265 typedef unsigned long DWORD_PTR
; // 32-bit
270 typedef int DEF
* PBOOL
;
271 typedef int NEAR
* NPBOOL
;
272 typedef int FAR
* LPBOOL
;
274 typedef int DEF
* PINT
;
275 typedef int NEAR
* NPINT
;
276 typedef int FAR
* LPINT
;
277 typedef const int DEF
* PCINT
;
278 typedef const int NEAR
* NPCINT
;
279 typedef const int FAR
* LPCINT
;
281 typedef unsigned int DEF
* PUINT
;
282 typedef const unsigned int DEF
* PCUINT
;
284 typedef long DEF
* PLONG
;
285 typedef long NEAR
* NPLONG
;
286 typedef long FAR
* LPLONG
;
287 //typedef const long DEF* PCLONG;
288 typedef const long NEAR
* NPCLONG
;
289 typedef const long FAR
* LPCLONG
;
291 typedef BYTE DEF
* PBYTE
;
292 typedef BYTE NEAR
* NPBYTE
;
293 typedef BYTE FAR
* LPBYTE
;
294 typedef const BYTE DEF
* PCBYTE
;
295 typedef const BYTE NEAR
* NPCBYTE
;
296 typedef const BYTE FAR
* LPCBYTE
;
298 typedef WORD DEF
* PWORD
;
299 typedef WORD NEAR
* NPWORD
;
300 typedef WORD FAR
* LPWORD
;
301 typedef const WORD DEF
* PCWORD
;
302 typedef const WORD NEAR
* NPCWORD
;
303 typedef const WORD FAR
* LPCWORD
;
305 typedef DWORD DEF
* PDWORD
;
306 typedef DWORD NEAR
* NPDWORD
;
307 typedef DWORD FAR
* LPDWORD
;
308 typedef const DWORD DEF
* PCDWORD
;
309 typedef const DWORD NEAR
* NPCDWORD
;
310 typedef const DWORD FAR
* LPCDWORD
;
312 typedef QWORD DEF
* PQWORD
;
313 typedef QWORD NEAR
* NPQWORD
;
314 typedef QWORD FAR
* LPQWORD
;
315 typedef const QWORD DEF
* PCQWORD
;
316 typedef const QWORD NEAR
* NPCQWORD
;
317 typedef const QWORD FAR
* LPCQWORD
;
319 typedef void DEF
* PVOID
;
320 typedef void NEAR
* NPVOID
;
321 typedef void FAR
* LPVOID
;
323 // handle declaration
325 typedef void *HANDLE
;
327 typedef PVOID HANDLE
;
331 // ANSI (Single-byte Character) types
333 typedef char DEF
* PCH
;
334 typedef char NEAR
* NPCH
;
335 typedef char FAR
* LPCH
;
336 typedef const char DEF
* PCCH
;
337 typedef const char NEAR
* NPCCH
;
338 typedef const char FAR
* LPCCH
;
340 typedef char DEF
* PSTR
;
341 typedef char NEAR
* NPSTR
;
342 typedef char FAR
* LPSTR
;
343 typedef const char DEF
* PCSTR
;
344 typedef const char NEAR
* NPCSTR
;
345 typedef const char FAR
* LPCSTR
;
352 /****** Misc definitions, types ********************************************/
364 // unreferenced parameter macro to avoid warning message in MS C
365 #if defined(__TURBOC__)
367 //you should use "#pragma argsused" to avoid warning message in Borland C
368 #ifndef UNREFERENCED_PARAMETER
369 #define UNREFERENCED_PARAMETER(x)
374 #ifndef UNREFERENCED_PARAMETER
375 //#define UNREFERENCED_PARAMETER(x) x
376 #define UNREFERENCED_PARAMETER(x)
382 // in-line assembly prefix
383 #if defined(__TURBOC__)
387 #endif // !__TURBOC__
392 #endif // __TTYPE_H__