1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef __TMACRO_H__
17 #define __TMACRO_H__
18
19
20
21 #if !defined(LOBYTE)
22 #define LOBYTE(w) ((unsigned char)(w))
23 #endif
24 #if !defined(HIBYTE)
25 #define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF))
26 #endif
27
28 #if !defined(LOWORD)
29 #define LOWORD(d) ((unsigned short)(d))
30 #endif
31 #if !defined(HIWORD)
32 #define HIWORD(d) ((unsigned short)((((unsigned long)(d)) >> 16) & 0xFFFF))
33 #endif
34
35 #define LODWORD(q) ((q).u.dwLowDword)
36 #define HIDWORD(q) ((q).u.dwHighDword)
37
38 #if !defined(MAKEWORD)
39 #define MAKEWORD(lb, hb) ((unsigned short)(((unsigned char)(lb)) | (((unsigned short)((unsigned char)(hb))) << 8)))
40 #endif
41 #if !defined(MAKEDWORD)
42 #define MAKEDWORD(lw, hw) ((unsigned long)(((unsigned short)(lw)) | (((unsigned long)((unsigned short)(hw))) << 16)))
43 #endif
44
45 #endif