home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / cecko / install / devcpp4920.exe / include / windef.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-14  |  4.9 KB  |  231 lines

  1. #ifndef _WINDEF_H
  2. #define _WINDEF_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. #ifndef WINVER
  8. #define WINVER 0x0400
  9. #endif
  10. #ifndef _WIN32_WINNT
  11. #define _WIN32_WINNT WINVER
  12. #endif
  13. #ifndef WIN32
  14. #define WIN32
  15. #endif
  16. #ifndef _WIN32
  17. #define _WIN32
  18. #endif
  19. #define FAR
  20. #define far
  21. #define NEAR
  22. #define near
  23. #ifndef CONST
  24. #define CONST const
  25. #endif
  26. #undef MAX_PATH
  27. #define MAX_PATH 260
  28.  
  29. #ifndef NULL
  30. #ifdef __cplusplus
  31. #define NULL 0
  32. #else
  33. #define NULL ((void*)0)
  34. #endif
  35. #endif
  36. #ifndef FALSE
  37. #define FALSE 0
  38. #endif
  39. #ifndef TRUE
  40. #define TRUE 1
  41. #endif
  42. #define IN
  43. #define OUT
  44. #ifndef OPTIONAL
  45. #define OPTIONAL
  46. #endif
  47.  
  48. #ifdef __GNUC__
  49. #define PACKED __attribute__((packed))
  50. #ifndef _stdcall
  51. #define _stdcall __attribute__((stdcall))
  52. #endif
  53. #ifndef __stdcall
  54. #define __stdcall __attribute__((stdcall))
  55. #endif
  56. #ifndef _cdecl
  57. #define _cdecl __attribute__((cdecl))
  58. #endif
  59. #ifndef __cdecl
  60. #define __cdecl __attribute__((cdecl))
  61. #endif
  62. #ifndef __declspec
  63. #define __declspec(e) __attribute__((e))
  64. #endif
  65. #ifndef _declspec
  66. #define _declspec(e) __attribute__((e))
  67. #endif
  68. #else
  69. #define PACKED
  70. #define _cdecl
  71. #define __cdecl
  72. #endif
  73.  
  74. #undef pascal
  75. #undef _pascal
  76. #undef __pascal
  77. #define pascal __stdcall
  78. #define _pascal __stdcall
  79. #define __pascal __stdcall
  80. #define PASCAL _pascal
  81. #define CDECL _cdecl
  82. #define STDCALL __stdcall
  83. #define WINAPI __stdcall
  84. #define WINAPIV __cdecl
  85. #define APIENTRY __stdcall
  86. #define CALLBACK __stdcall
  87. #define APIPRIVATE __stdcall
  88.  
  89. #define DECLSPEC_IMPORT __declspec(dllimport)
  90. #define DECLSPEC_EXPORT __declspec(dllexport)
  91. #define DECLSPEC_NORETURN __declspec(noreturn)
  92. #define MAKEWORD(a,b)    ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
  93. #define MAKELONG(a,b)    ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
  94. #define LOWORD(l)    ((WORD)((DWORD)(l)))
  95. #define HIWORD(l)    ((WORD)(((DWORD)(l)>>16)&0xFFFF))
  96. #define LOBYTE(w)    ((BYTE)(w))
  97. #define HIBYTE(w)    ((BYTE)(((WORD)(w)>>8)&0xFF))
  98.  
  99. #ifndef _export
  100. #define _export
  101. #endif
  102. #ifndef __export
  103. #define __export
  104. #endif
  105.  
  106. #ifndef NOMINMAX
  107. #ifndef max
  108. #define max(a,b) ((a)>(b)?(a):(b))
  109. #endif
  110. #ifndef min
  111. #define min(a,b) ((a)<(b)?(a):(b))
  112. #endif
  113. #endif
  114.  
  115. #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
  116. #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
  117. #define DBG_UNREFERENCED_PARAMETER(P)
  118. #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
  119.  
  120. typedef unsigned long DWORD;
  121. typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
  122. /* FIXME: Is there a good solution to this? */
  123. #ifndef XFree86Server
  124. #ifndef __OBJC__
  125. typedef WINBOOL BOOL;
  126. #else
  127. #define BOOL WINBOOL
  128. #endif
  129. typedef unsigned char BYTE;
  130. #endif /* ndef XFree86Server */
  131. typedef BOOL *PBOOL,*LPBOOL;
  132. typedef unsigned short WORD;
  133. typedef float FLOAT;
  134. typedef FLOAT *PFLOAT;
  135. typedef BYTE *PBYTE,*LPBYTE;
  136. typedef int *PINT,*LPINT;
  137. typedef WORD *PWORD,*LPWORD;
  138. typedef long *LPLONG;
  139. typedef DWORD *PDWORD,*LPDWORD;
  140. typedef void *PVOID,*LPVOID;
  141. typedef CONST void *PCVOID,*LPCVOID;
  142. typedef int INT;
  143. typedef unsigned int UINT,*PUINT,*LPUINT;
  144.  
  145. #include <winnt.h>
  146.  
  147. typedef UINT WPARAM;
  148. typedef LONG LPARAM;
  149. typedef LONG LRESULT;
  150. #ifndef _HRESULT_DEFINED
  151. typedef LONG HRESULT;
  152. #define _HRESULT_DEFINED
  153. #endif
  154. #ifndef XFree86Server
  155. typedef WORD ATOM;
  156. #endif /* XFree86Server */
  157. typedef HANDLE HGLOBAL;
  158. typedef HANDLE HLOCAL;
  159. typedef HANDLE GLOBALHANDLE;
  160. typedef HANDLE LOCALHANDLE;
  161. typedef void *HGDIOBJ;
  162. DECLARE_HANDLE(HACCEL);
  163. DECLARE_HANDLE(HBITMAP);
  164. DECLARE_HANDLE(HBRUSH);
  165. DECLARE_HANDLE(HCOLORSPACE);
  166. DECLARE_HANDLE(HDC);
  167. DECLARE_HANDLE(HGLRC);
  168. DECLARE_HANDLE(HDESK);
  169. DECLARE_HANDLE(HENHMETAFILE);
  170. DECLARE_HANDLE(HFONT);
  171. DECLARE_HANDLE(HICON);
  172. DECLARE_HANDLE(HKEY);
  173. /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
  174. /* #if (WINVER >= 0x0500) */
  175. DECLARE_HANDLE(HMONITOR);
  176. #define HMONITOR_DECLARED 1
  177. DECLARE_HANDLE(HTERMINAL);
  178. DECLARE_HANDLE(HWINEVENTHOOK);
  179. /* #endif */
  180. typedef HKEY *PHKEY;
  181. DECLARE_HANDLE(HMENU);
  182. DECLARE_HANDLE(HMETAFILE);
  183. DECLARE_HANDLE(HINSTANCE);
  184. typedef HINSTANCE HMODULE;
  185. DECLARE_HANDLE(HPALETTE);
  186. DECLARE_HANDLE(HPEN);
  187. DECLARE_HANDLE(HRGN);
  188. DECLARE_HANDLE(HRSRC);
  189. DECLARE_HANDLE(HSTR);
  190. DECLARE_HANDLE(HTASK);
  191. DECLARE_HANDLE(HWND);
  192. DECLARE_HANDLE(HWINSTA);
  193. DECLARE_HANDLE(HKL);
  194. typedef int HFILE;
  195. typedef HICON HCURSOR;
  196. typedef DWORD COLORREF;
  197. typedef int (WINAPI *FARPROC)();
  198. typedef int (WINAPI *NEARPROC)();
  199. typedef int (WINAPI *PROC)();
  200. typedef struct tagRECT {
  201.     LONG left;
  202.     LONG top;
  203.     LONG right;
  204.     LONG bottom;
  205. } RECT,*PRECT,*LPRECT;
  206. typedef const RECT *LPCRECT;
  207. typedef struct tagRECTL {
  208.     LONG left;
  209.     LONG top;
  210.     LONG right;
  211.     LONG bottom;
  212. } RECTL,*PRECTL,*LPRECTL;
  213. typedef const RECTL *LPCRECTL;
  214. typedef struct tagPOINT {
  215.     LONG x;
  216.     LONG y;
  217. } POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
  218. typedef struct tagSIZE {
  219.     LONG cx;
  220.     LONG cy;
  221. } SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
  222. typedef struct tagPOINTS {
  223.     SHORT x;
  224.     SHORT y;
  225. } POINTS,*PPOINTS,*LPPOINTS;
  226.  
  227. #ifdef __cplusplus
  228. }
  229. #endif
  230. #endif
  231.