diff src/main/win32/SDL_win32_main.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents d7bca8c8161e
children c71e05b4dc2e
line wrap: on
line diff
--- a/src/main/win32/SDL_win32_main.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/main/win32/SDL_win32_main.c	Tue Feb 07 06:59:48 2006 +0000
@@ -5,12 +5,12 @@
 */
 
 #include <stdio.h>
-#include <string.h>
-#include <ctype.h>
 #include <stdlib.h>
 
-#include <windows.h>
-#include <malloc.h>			/* For _alloca() */
+#include "SDL_windows.h"
+
+#include "SDL_stdlib.h"
+#include "SDL_string.h"
 
 #ifdef _WIN32_WCE
 # define DIR_SEPERATOR TEXT("\\")
@@ -56,7 +56,7 @@
 #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
 
 /* seems to be undefined in Win CE although in online help */
-char *strrchr(char *str, int c)
+char *SDL_strrchr(char *str, int c)
 {
 	char *p;
 
@@ -195,15 +195,15 @@
 
 	/* Get the class name from argv[0] */
 	appname = argv[0];
-	if ( (bufp=strrchr(argv[0], '\\')) != NULL ) {
+	if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) {
 		appname = bufp+1;
 	} else
-	if ( (bufp=strrchr(argv[0], '/')) != NULL ) {
+	if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) {
 		appname = bufp+1;
 	}
 
-	if ( (bufp=strrchr(appname, '.')) == NULL )
-		n = strlen(appname);
+	if ( (bufp=SDL_strrchr(appname, '.')) == NULL )
+		n = SDL_strlen(appname);
 	else
 		n = (bufp-appname);
 
@@ -211,7 +211,7 @@
 	if ( bufp == NULL ) {
 		return OutOfMemory();
 	}
-	strncpy(bufp, appname, n);
+	SDL_strncpy(bufp, appname, n);
 	bufp[n] = '\0';
 	appname = bufp;
 
@@ -298,8 +298,8 @@
 	}
 	path[pathlen] = '\0';
 
-	strcpy( stdoutPath, path );
-	strcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE );
+	SDL_strcpy( stdoutPath, path );
+	SDL_strcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE );
     
 	/* Redirect standard input and standard output */
 	newfp = freopen(stdoutPath, TEXT("w"), stdout);
@@ -317,8 +317,8 @@
 	}
 #endif /* _WIN32_WCE */
 
-	strcpy( stderrPath, path );
-	strcat( stderrPath, DIR_SEPERATOR STDERR_FILE );
+	SDL_strcpy( stderrPath, path );
+	SDL_strcat( stderrPath, DIR_SEPERATOR STDERR_FILE );
 
 	newfp = freopen(stderrPath, TEXT("w"), stderr);
 #ifndef _WIN32_WCE
@@ -354,11 +354,11 @@
 #else
 	/* Grab the command line (use alloca() on Windows) */
 	bufp = GetCommandLine();
-	cmdline = (char *)alloca(strlen(bufp)+1);
+	cmdline = (char *)alloca(SDL_strlen(bufp)+1);
 	if ( cmdline == NULL ) {
 		return OutOfMemory();
 	}
-	strcpy(cmdline, bufp);
+	SDL_strcpy(cmdline, bufp);
 #endif
 
 	/* Parse it into argv and argc */