src/file/SDL_rwops.c
branchgsoc2008_nds
changeset 2674 f1d07ba2e275
parent 2185 2032348afed1
child 2676 082cc3ffd7d8
--- a/src/file/SDL_rwops.c	Thu Jun 19 07:11:35 2008 +0000
+++ b/src/file/SDL_rwops.c	Mon Jun 23 11:55:26 2008 +0000
@@ -28,6 +28,10 @@
 #include "SDL_endian.h"
 #include "SDL_rwops.h"
 
+#ifdef __NDS__
+/* include libfat headers for fatInitDefault(). */
+#include <fat.h>
+#endif /* __NDS__ */
 
 #ifdef __WIN32__
 
@@ -462,7 +466,10 @@
 SDL_RWFromFP(FILE * fp, SDL_bool autoclose)
 {
     SDL_RWops *rwops = NULL;
-
+#ifdef __NDS__
+    /* set it up so we can use stdio file function */
+    fatInitDefault();
+#endif /* __NDS__ */
     rwops = SDL_AllocRW();
     if (rwops != NULL) {
         rwops->seek = stdio_seek;