src/SDL_log.c
changeset 7009 161b7b6a5303
parent 6885 700f1b25f77f
child 7191 75360622e65f
child 8460 f483e8bdae3c
--- a/src/SDL_log.c	Sat Mar 16 11:00:04 2013 -0700
+++ b/src/SDL_log.c	Sun Mar 17 20:07:02 2013 +0800
@@ -327,6 +327,20 @@
             return;
         }
     }
+#elif defined(__PSP__)
+//Simple Log System for PSP
+	{
+		unsigned int length;
+		char*		 output;
+		FILE*		 pFile;
+		length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1;
+        output = SDL_stack_alloc(char, length);
+		SDL_snprintf(output, length, "%s: %s", SDL_priority_prefixes[priority], message);
+		pFile = fopen ("SDL_Log.txt", "a");
+		fwrite (output, strlen (output), 1, pFile);
+		SDL_stack_free(output);
+		fclose (pFile);
+	}
 #endif
 #if HAVE_STDIO_H
     fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message);