[Scummvm-cvs-logs] CVS: scummvm/backends/wince/missing missing.cpp,1.1.1.1,1.2

Nicolas Bacca arisme at users.sourceforge.net
Wed Oct 30 17:05:12 CET 2002


Update of /cvsroot/scummvm/scummvm/backends/wince/missing
In directory usw-pr-cvs1:/tmp/cvs-serv8534

Modified Files:
	missing.cpp 
Log Message:
Real HPC support (work in progress)

Index: missing.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/missing/missing.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- missing.cpp	21 Aug 2002 16:07:21 -0000	1.1.1.1
+++ missing.cpp	31 Oct 2002 01:04:47 -0000	1.2
@@ -13,8 +13,17 @@
 #include "dirent.h"
 
 /* forward declaration */
+
+#if _WIN32_WCE < 300
+
+#include "portdefs.h"
+
+#else
+
 char *strdup(const char *strSource);
 
+#endif
+
 /* Limited dirent implementation. Used by UI.C and DEVICES.C */
 static WIN32_FIND_DATA wfd;
 
@@ -198,6 +207,7 @@
 /* Used in DEVICES.C and UI.C for some purpose. Not critical in this port */
 int system(const char* path) { return 0; }
 
+#if 0
 
 char *tmpnam(char *string)
 {
@@ -224,6 +234,8 @@
 		return 0;
 }
 
+#endif
+
 void rewind(FILE *stream)
 {
 	fseek(stream, 0, SEEK_SET);
@@ -376,3 +388,78 @@
 			return (void*)((size_t)base + size * i);
 	return NULL;
 }
+
+#if _WIN32_WCE < 300
+
+void *calloc(size_t n, size_t s) {
+	void *result = malloc(n * s);
+	if (result) 
+		memset(result, 0, n * s);
+
+	return result;
+}
+
+int isdigit(int c) {
+	return (c >='0' && c <= '9');
+}
+
+void assert (int expression) {
+	if (!expression)
+		abort();
+}
+
+void assert (void *expression) {
+	if (!expression)
+		abort();
+}
+
+int stricmp( const char *string1, const char *string2 ) {
+	char src[4096];
+	char dest[4096];
+	int i;
+
+	for (i=0; i<strlen(string1); i++)
+		if (string1[i] >= 'A' && string1[i] <= 'Z')
+			src[i] = string1[i] + 32;
+		else
+			src[i] = string1[i];
+	src[i] = 0;
+
+	for (i=0; i<strlen(string2); i++)
+		if (string2[i] >= 'A' && string2[i] <= 'Z')
+			dest[i] = string2[i] + 32;
+		else
+			dest[i] = string2[i];
+	dest[i] = 0;
+
+	return strcmp(src, dest);
+}
+
+int _stricmp( const char *string1, const char *string2 ) {
+	return stricmp(string1, string2);
+}
+
+char *strrchr(const char *s, int c) {
+	int i;
+
+	for (i = strlen(s) - 1; i > 0; i++)
+		if (s[i] == c)
+			return (char*)(s + i);
+
+	return NULL;
+}
+
+long int strtol(const char *nptr, char **endptr, int base) {
+	// not correct but that's all we are using
+
+	long int result;
+
+	sscanf(nptr, "%ld", &result);
+
+	return result;
+}
+		
+
+#endif
+		
+





More information about the Scummvm-git-logs mailing list