5050#define __pragma (...) _Pragma (#__VA_ARGS__)
5151#define __declspec (x )
5252#define CALLBACK
53+ #define TEXT (x ) strdup(x)
54+
55+ inline char *_strlwr_l (char *str, locale_t loc)
56+ {
57+ // TODO
58+ }
59+
60+ inline char *_strupr_l (char *str, locale_t loc)
61+ {
62+ // TODO
63+ }
64+
65+ #define VOID void
66+ #define HKL void *
67+ #define ActivateKeyboardLayout (x, y ) {}
68+ #define GetCursorPos (point ) {}
69+ #define ScreenToClient (hwnd, p ) {}
5370
5471#define __except (X ) catch (X)
5572
@@ -94,7 +111,7 @@ inline int GetExceptionCode()
94111
95112#define xr_unlink unlink
96113
97- typedef char BOOL;
114+ typedef bool BOOL;
98115typedef char * LPSTR;
99116typedef char * PSTR;
100117typedef char * LPTSTR;
@@ -131,6 +148,28 @@ typedef struct {
131148 WORD cbSize;
132149} WAVEFORMATEX, *LPWAVEFORMATEX;
133150
151+ typedef struct tagSTICKYKEYS
152+ {
153+ DWORD cbSize;
154+ DWORD dwFlags;
155+ } STICKYKEYS, *LPSTICKYKEYS;
156+
157+ typedef struct tagFILTERKEYS
158+ {
159+ UINT cbSize;
160+ DWORD dwFlags;
161+ DWORD iWaitMSec;
162+ DWORD iDelayMSec;
163+ DWORD iRepeatMSec;
164+ DWORD iBounceMSec;
165+ } FILTERKEYS, *LPFILTERKEYS;
166+
167+ typedef struct tagTOGGLEKEYS
168+ {
169+ DWORD cbSize;
170+ DWORD dwFlags;
171+ } TOGGLEKEYS, *LPTOGGLEKEYS;
172+
134173typedef struct _EXCEPTION_POINTERS {
135174} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
136175
@@ -172,10 +211,15 @@ typedef struct tagPOINT {
172211 long y;
173212} POINT, *PPOINT, *LPPOINT;
174213
214+ #define DWORD_PTR UINT_PTR
175215#define WM_USER 0x0400
216+ #define WA_INACTIVE 0
217+ #define HIWORD (l ) ((WORD)((DWORD_PTR)(l) >> 16 ))
218+ #define LOWORD (l ) ((WORD)((DWORD_PTR)(l) & 0xFFFF ))
219+
176220
177- #define TRUE 1
178- #define FALSE 0
221+ #define TRUE true
222+ #define FALSE false
179223#define NONE 0
180224#define CONST const
181225
@@ -196,9 +240,12 @@ typedef dirent DirEntryType;
196240#define strcmpi stricmp
197241#define lstrcpy strcpy
198242#define stricmp strcasecmp
199- #define strncpy_s (dest, size, source, num ) strncpy(dest, source, num)
200- #define strcpy_s (dest, num, source ) strcpy(dest, source)
243+ #define strupr SDL_strupr
244+ #define strncpy_s (dest, size, source, num ) (NULL == strncpy(dest, source, num))
245+ #define strcpy_s (dest, num, source ) (NULL == strcpy(dest, source))
246+ #define strcat_s (dest, num, source ) (dest == strcat(dest, source))
201247#define _vsnprintf vsnprintf
248+ #define vsprintf_s (dest, size, format, args ) vsprintf(dest, format, args)
202249#define _alloca alloca
203250#define _snprintf snprintf
204251#define sprintf_s (buffer, buffer_size, stringbuffer, ...) sprintf(buffer, stringbuffer, ##__VA_ARGS__)
@@ -241,7 +288,11 @@ inline int _filelength(int fd)
241288#define __max (a, b ) std::max(a, b)
242289#define __min (a, b ) std::min(a, b)
243290
244- #define xr_itoa SDL_itoa
291+ #define itoa SDL_itoa
292+ #define _itoa_s (value, buffer, radix ) SDL_itoa(value, buffer, radix)
293+ #define _locale_t locale_t
294+ #define _isalpha_l isalpha_l
295+ #define _create_locale (category, arg ) newlocale(category, arg, (locale_t ) 0 )
245296
246297#define ZeroMemory (p, sz ) memset((p), 0 , (sz))
247298#define CopyMemory (d, s, n ) memcpy(d, s, n)
@@ -256,4 +307,7 @@ inline int _filelength(int fd)
256307#define _MAX_DRIVE 3
257308#define _MAX_DIR 256
258309#define _MAX_FNAME 256
259- #define _MAX_EXT 256
310+ #define _MAX_EXT 256
311+
312+ #define SEM_FAILCRITICALERRORS 1
313+ #define SetErrorMode (x ) {x=x}
0 commit comments