src/main/win32/SDL_win32_main.c
changeset 1336 3692456e7b0f
parent 1286 d7bca8c8161e
child 1358 c71e05b4dc2e
     1.1 --- a/src/main/win32/SDL_win32_main.c	Mon Feb 06 17:28:04 2006 +0000
     1.2 +++ b/src/main/win32/SDL_win32_main.c	Tue Feb 07 06:59:48 2006 +0000
     1.3 @@ -5,12 +5,12 @@
     1.4  */
     1.5  
     1.6  #include <stdio.h>
     1.7 -#include <string.h>
     1.8 -#include <ctype.h>
     1.9  #include <stdlib.h>
    1.10  
    1.11 -#include <windows.h>
    1.12 -#include <malloc.h>			/* For _alloca() */
    1.13 +#include "SDL_windows.h"
    1.14 +
    1.15 +#include "SDL_stdlib.h"
    1.16 +#include "SDL_string.h"
    1.17  
    1.18  #ifdef _WIN32_WCE
    1.19  # define DIR_SEPERATOR TEXT("\\")
    1.20 @@ -56,7 +56,7 @@
    1.21  #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
    1.22  
    1.23  /* seems to be undefined in Win CE although in online help */
    1.24 -char *strrchr(char *str, int c)
    1.25 +char *SDL_strrchr(char *str, int c)
    1.26  {
    1.27  	char *p;
    1.28  
    1.29 @@ -195,15 +195,15 @@
    1.30  
    1.31  	/* Get the class name from argv[0] */
    1.32  	appname = argv[0];
    1.33 -	if ( (bufp=strrchr(argv[0], '\\')) != NULL ) {
    1.34 +	if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) {
    1.35  		appname = bufp+1;
    1.36  	} else
    1.37 -	if ( (bufp=strrchr(argv[0], '/')) != NULL ) {
    1.38 +	if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) {
    1.39  		appname = bufp+1;
    1.40  	}
    1.41  
    1.42 -	if ( (bufp=strrchr(appname, '.')) == NULL )
    1.43 -		n = strlen(appname);
    1.44 +	if ( (bufp=SDL_strrchr(appname, '.')) == NULL )
    1.45 +		n = SDL_strlen(appname);
    1.46  	else
    1.47  		n = (bufp-appname);
    1.48  
    1.49 @@ -211,7 +211,7 @@
    1.50  	if ( bufp == NULL ) {
    1.51  		return OutOfMemory();
    1.52  	}
    1.53 -	strncpy(bufp, appname, n);
    1.54 +	SDL_strncpy(bufp, appname, n);
    1.55  	bufp[n] = '\0';
    1.56  	appname = bufp;
    1.57  
    1.58 @@ -298,8 +298,8 @@
    1.59  	}
    1.60  	path[pathlen] = '\0';
    1.61  
    1.62 -	strcpy( stdoutPath, path );
    1.63 -	strcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE );
    1.64 +	SDL_strcpy( stdoutPath, path );
    1.65 +	SDL_strcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE );
    1.66      
    1.67  	/* Redirect standard input and standard output */
    1.68  	newfp = freopen(stdoutPath, TEXT("w"), stdout);
    1.69 @@ -317,8 +317,8 @@
    1.70  	}
    1.71  #endif /* _WIN32_WCE */
    1.72  
    1.73 -	strcpy( stderrPath, path );
    1.74 -	strcat( stderrPath, DIR_SEPERATOR STDERR_FILE );
    1.75 +	SDL_strcpy( stderrPath, path );
    1.76 +	SDL_strcat( stderrPath, DIR_SEPERATOR STDERR_FILE );
    1.77  
    1.78  	newfp = freopen(stderrPath, TEXT("w"), stderr);
    1.79  #ifndef _WIN32_WCE
    1.80 @@ -354,11 +354,11 @@
    1.81  #else
    1.82  	/* Grab the command line (use alloca() on Windows) */
    1.83  	bufp = GetCommandLine();
    1.84 -	cmdline = (char *)alloca(strlen(bufp)+1);
    1.85 +	cmdline = (char *)alloca(SDL_strlen(bufp)+1);
    1.86  	if ( cmdline == NULL ) {
    1.87  		return OutOfMemory();
    1.88  	}
    1.89 -	strcpy(cmdline, bufp);
    1.90 +	SDL_strcpy(cmdline, bufp);
    1.91  #endif
    1.92  
    1.93  	/* Parse it into argv and argc */