Mercurial > sdl-ios-xcode
comparison src/main/win32/SDL_main.c @ 112:9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Wed, 18 Jul 2001 20:04:23 +0000 |
parents | 13ee9f4834ea |
children | 29a638dc26db |
comparison
equal
deleted
inserted
replaced
111:53e3d8ba4321 | 112:9ef74357a5fb |
---|---|
14 | 14 |
15 /* Include the SDL main definition header */ | 15 /* Include the SDL main definition header */ |
16 #include "SDL.h" | 16 #include "SDL.h" |
17 #include "SDL_main.h" | 17 #include "SDL_main.h" |
18 #ifdef main | 18 #ifdef main |
19 #ifndef _WIN32_WCE_EMULATION | |
19 #undef main | 20 #undef main |
21 #endif | |
20 #endif | 22 #endif |
21 | 23 |
22 /* Do we really not want stdio redirection with Windows CE? */ | 24 /* Do we really not want stdio redirection with Windows CE? */ |
23 #ifdef _WIN32_WCE | 25 #ifdef _WIN32_WCE |
24 #define NO_STDIO_REDIRECT | 26 #define NO_STDIO_REDIRECT |
26 | 28 |
27 /* The standard output files */ | 29 /* The standard output files */ |
28 #define STDOUT_FILE TEXT("stdout.txt") | 30 #define STDOUT_FILE TEXT("stdout.txt") |
29 #define STDERR_FILE TEXT("stderr.txt") | 31 #define STDERR_FILE TEXT("stderr.txt") |
30 | 32 |
31 #ifdef _WIN32_WCE | 33 #if defined(_WIN32_WCE) && _WIN32_WCE < 300 |
32 /* seems to be undefined in Win CE although in online help */ | 34 /* seems to be undefined in Win CE although in online help */ |
33 #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) | 35 #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) |
34 | 36 |
35 /* seems to be undefined in Win CE although in online help */ | 37 /* seems to be undefined in Win CE although in online help */ |
36 char *strrchr(char *str, int c) | 38 char *strrchr(char *str, int c) |
50 if ( p < str ) { | 52 if ( p < str ) { |
51 p = NULL; | 53 p = NULL; |
52 } | 54 } |
53 return p; | 55 return p; |
54 } | 56 } |
55 #endif /* _WIN32_WCE */ | 57 #endif /* _WIN32_WCE < 300 */ |
56 | 58 |
57 /* Parse a command line buffer into arguments */ | 59 /* Parse a command line buffer into arguments */ |
58 static int ParseCommandLine(char *cmdline, char **argv) | 60 static int ParseCommandLine(char *cmdline, char **argv) |
59 { | 61 { |
60 char *bufp; | 62 char *bufp; |
272 | 274 |
273 #ifdef _WIN32_WCE | 275 #ifdef _WIN32_WCE |
274 nLen = wcslen(szCmdLine)+128+1; | 276 nLen = wcslen(szCmdLine)+128+1; |
275 bufp = (wchar_t *)alloca(nLen*2); | 277 bufp = (wchar_t *)alloca(nLen*2); |
276 GetModuleFileName(NULL, bufp, 128); | 278 GetModuleFileName(NULL, bufp, 128); |
277 wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen); | 279 wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp)); |
278 nLen = wcslen(bufp)+1; | 280 nLen = wcslen(bufp)+1; |
279 cmdline = (char *)alloca(nLen); | 281 cmdline = (char *)alloca(nLen); |
280 if ( cmdline == NULL ) { | 282 if ( cmdline == NULL ) { |
281 return OutOfMemory(); | 283 return OutOfMemory(); |
282 } | 284 } |