README: explain further musl-specific tweaks
[rofl0r-df-libgraphics.git] / g_src / platform.h
blob64e5c74433c125520d03d1d66fc6f0fc072c1cab
1 #ifndef _PLATFORM_H_
2 #define _PLATFORM_H_
4 #ifdef WIN32
5 #undef WINDOWS_LEAN_AND_MEAN
6 #define WINDOWS_LEAN_AND_MEAN
7 # include <windows.h>
8 #else
10 #define stricmp strcasecmp
11 #define strnicmp strncasecmp
13 enum {
14 // NOTE: These probably don't match Windows values.
15 MB_OK = 0x01,
16 MB_YESNO = 0x02,
17 MB_ICONQUESTION = 0x10,
18 MB_ICONEXCLAMATION = 0x20,
20 IDOK = 1,
21 IDNO,
22 IDYES,
26 typedef int HANDLE;
27 typedef HANDLE HINSTANCE;
28 typedef HANDLE HWND;
29 typedef HANDLE HDC;
30 typedef HANDLE HGLRC;
32 #ifndef HWND_DESKTOP
33 #define HWND_DESKTOP ((HWND)-1)
34 #endif
37 typedef int BOOL;
39 #ifndef FALSE
40 #define FALSE 0
41 #endif
42 #ifndef TRUE
43 #define TRUE 1
44 #endif
46 typedef unsigned short WORD;
47 typedef unsigned long DWORD;
49 typedef unsigned int UINT;
50 typedef short SHORT;
51 typedef long LONG;
52 typedef long long LONGLONG;
54 typedef WORD WPARAM;
55 typedef DWORD LPARAM;
58 typedef struct {
59 LONG x;
60 LONG y;
61 } POINT;
63 typedef union {
64 struct {
65 DWORD LowPart;
66 LONG HighPart;
68 struct {
69 DWORD LowPart;
70 LONG HighPart;
71 } u;
72 LONGLONG QuadPart;
73 } LARGE_INTEGER;
75 typedef struct {
76 HWND hwnd;
77 UINT message;
78 WPARAM wParam;
79 LPARAM lParam;
80 DWORD time;
81 POINT pt;
82 } MSG;
85 DWORD GetTickCount(); // returns ms since system startup
86 BOOL CreateDirectory(const char* pathname, void*);
87 BOOL DeleteFile(const char* filename);
88 void ZeroMemory(void* dest, int len);
89 BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount);
90 BOOL QueryPerformanceFrequency(LARGE_INTEGER* performanceCount);
91 int MessageBox(HWND *dummy, const char* text, const char* caption, UINT type);
92 char* itoa(int value, char* result, int base);
94 #endif // WIN32
97 SHORT Enabler_GetKeyState(int virtKey);
98 int Enabler_ShowCursor(BOOL show);
101 #endif // _PLATFORM_H_