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 ***********************************/
56 #if! defined(__CPU8051)
77 //2007-0809-01<Add>by MikeLiu
78 #ifndef update_BssList
79 #define update_BssList
84 #ifndef WPA_SM_Transtatus
85 #define WPA_SM_Transtatus
88 #ifndef Calcu_LinkQual
89 #define Calcu_LinkQual
92 #ifndef Calcu_LinkQual
93 #define Calcu_LinkQual
96 /****** Simple typedefs ***************************************************/
98 #if! defined(__CPU8051)
100 /* These lines assume that your compiler's longs are 32 bits and
101 * shorts are 16 bits. It is already assumed that chars are 8 bits,
102 * but it doesn't matter if they're signed or unsigned.
105 typedef signed char I8; /* 8-bit signed integer */
106 typedef signed short I16; /* 16-bit signed integer */
107 typedef signed long I32; /* 32-bit signed integer */
109 typedef unsigned char U8; /* 8-bit unsigned integer */
110 typedef unsigned short U16; /* 16-bit unsigned integer */
111 typedef unsigned long U32; /* 32-bit unsigned integer */
115 typedef signed __int64 I64; /* 64-bit signed integer */
116 typedef unsigned __int64 U64; /* 64-bit unsigned integer */
121 typedef signed short SHORT;
122 typedef signed int INT;
123 typedef signed long LONG;
125 typedef unsigned char UCHAR;
126 typedef unsigned short USHORT;
127 typedef unsigned int UINT;
128 typedef unsigned long ULONG;
129 typedef unsigned long long ULONGLONG; //64 bit
130 typedef unsigned long long ULONGULONG;
134 typedef unsigned char BYTE; // 8-bit
135 typedef unsigned short WORD; // 16-bit
136 typedef unsigned long DWORD; // 32-bit
138 // QWORD is for those situation that we want
139 // an 8-byte-aligned 8 byte long structure
140 // which is NOT really a floating point number.
141 typedef union tagUQuadWord {
146 double DoNotUseThisField;
148 typedef UQuadWord QWORD; // 64-bit
152 #ifndef _TCHAR_DEFINED
154 typedef char* PTCHAR;
155 typedef unsigned char TBYTE;
156 typedef unsigned char* PTBYTE;
157 #define _TCHAR_DEFINED
162 #define U8 unsigned char
163 #define U16 unsigned short
164 #define U32 unsigned long
166 #define USHORT unsigned short
167 #define UINT unsigned int
169 #define BYTE unsigned char
170 #define WORD unsigned short
171 #define DWORD unsigned long
177 // maybe this should be defined in <limits.h>
179 #define U16_MAX 0xFFFFU
180 #define U32_MAX 0xFFFFFFFFUL
182 #define BYTE_MAX 0xFFU
183 #define WORD_MAX 0xFFFFU
184 #define DWORD_MAX 0xFFFFFFFFUL
189 /******* 32-bit vs. 16-bit definitions and typedefs ************************/
195 #define NULL ((void *)0)
196 #endif // __cplusplus
202 #if defined(__WIN32) || defined(__CPU8051)
213 #if !defined(CALLBACK)
226 // default pointer type is FAR, if you want near pointer just redefine it to NEAR
229 #if !defined(CALLBACK)
238 /****** Common pointer types ***********************************************/
240 #if! defined(__CPU8051)
242 typedef signed char DEF* PI8;
243 typedef signed short DEF* PI16;
244 typedef signed long DEF* PI32;
246 typedef unsigned char DEF* PU8;
247 typedef unsigned short DEF* PU16;
248 typedef unsigned long DEF* PU32;
251 typedef signed __int64 DEF* PI64;
252 typedef unsigned __int64 DEF* PU64;
256 typedef unsigned long ULONG_PTR; // 32-bit
257 typedef unsigned long DWORD_PTR; // 32-bit
262 typedef int DEF* PBOOL;
263 typedef int NEAR* NPBOOL;
264 typedef int FAR* LPBOOL;
266 typedef int DEF* PINT;
267 typedef int NEAR* NPINT;
268 typedef int FAR* LPINT;
269 typedef const int DEF* PCINT;
270 typedef const int NEAR* NPCINT;
271 typedef const int FAR* LPCINT;
273 typedef unsigned int DEF* PUINT;
274 typedef const unsigned int DEF* PCUINT;
276 typedef long DEF* PLONG;
277 typedef long NEAR* NPLONG;
278 typedef long FAR* LPLONG;
279 //typedef const long DEF* PCLONG;
280 typedef const long NEAR* NPCLONG;
281 typedef const long FAR* LPCLONG;
283 typedef BYTE DEF* PBYTE;
284 typedef BYTE NEAR* NPBYTE;
285 typedef BYTE FAR* LPBYTE;
286 typedef const BYTE DEF* PCBYTE;
287 typedef const BYTE NEAR* NPCBYTE;
288 typedef const BYTE FAR* LPCBYTE;
290 typedef WORD DEF* PWORD;
291 typedef WORD NEAR* NPWORD;
292 typedef WORD FAR* LPWORD;
293 typedef const WORD DEF* PCWORD;
294 typedef const WORD NEAR* NPCWORD;
295 typedef const WORD FAR* LPCWORD;
297 typedef DWORD DEF* PDWORD;
298 typedef DWORD NEAR* NPDWORD;
299 typedef DWORD FAR* LPDWORD;
300 typedef const DWORD DEF* PCDWORD;
301 typedef const DWORD NEAR* NPCDWORD;
302 typedef const DWORD FAR* LPCDWORD;
304 typedef QWORD DEF* PQWORD;
305 typedef QWORD NEAR* NPQWORD;
306 typedef QWORD FAR* LPQWORD;
307 typedef const QWORD DEF* PCQWORD;
308 typedef const QWORD NEAR* NPCQWORD;
309 typedef const QWORD FAR* LPCQWORD;
311 typedef void DEF* PVOID;
312 typedef void NEAR* NPVOID;
313 typedef void FAR* LPVOID;
315 // handle declaration
317 typedef void *HANDLE;
319 typedef PVOID HANDLE;
323 // ANSI (Single-byte Character) types
325 typedef char DEF* PCH;
326 typedef char NEAR* NPCH;
327 typedef char FAR* LPCH;
328 typedef const char DEF* PCCH;
329 typedef const char NEAR* NPCCH;
330 typedef const char FAR* LPCCH;
332 typedef char DEF* PSTR;
333 typedef char NEAR* NPSTR;
334 typedef char FAR* LPSTR;
335 typedef const char DEF* PCSTR;
336 typedef const char NEAR* NPCSTR;
337 typedef const char FAR* LPCSTR;
344 /****** Misc definitions, types ********************************************/
356 // unreferenced parameter macro to avoid warning message in MS C
357 #if defined(__TURBOC__)
359 //you should use "#pragma argsused" to avoid warning message in Borland C
360 #ifndef UNREFERENCED_PARAMETER
361 #define UNREFERENCED_PARAMETER(x)
366 #ifndef UNREFERENCED_PARAMETER
367 //#define UNREFERENCED_PARAMETER(x) x
368 #define UNREFERENCED_PARAMETER(x)
374 // in-line assembly prefix
375 #if defined(__TURBOC__)
379 #endif // !__TURBOC__
384 #endif // __TTYPE_H__