Add a dummy function if SDL doesn't have STDIO support
authorSam Lantinga <slouken@libsdl.org>
Tue, 15 Dec 2009 05:34:58 +0000
changeset 3564 d264d99576c1
parent 3563 d3a8bb6a37c1
child 3565 f43c8f688f77
Add a dummy function if SDL doesn't have STDIO support
include/SDL_rwops.h
src/file/SDL_rwops.c
--- a/include/SDL_rwops.h	Tue Dec 15 02:16:01 2009 +0000
+++ b/include/SDL_rwops.h	Tue Dec 15 05:34:58 2009 +0000
@@ -131,6 +131,9 @@
 #ifdef HAVE_STDIO_H
 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
                                                 SDL_bool autoclose);
+#else
+extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
+                                                SDL_bool autoclose);
 #endif
 
 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
--- a/src/file/SDL_rwops.c	Tue Dec 15 02:16:01 2009 +0000
+++ b/src/file/SDL_rwops.c	Tue Dec 15 05:34:58 2009 +0000
@@ -497,6 +497,13 @@
     }
     return (rwops);
 }
+#else
+SDL_RWops *
+SDL_RWFromFP(void * fp, SDL_bool autoclose)
+{
+    SDL_SetError("SDL not compiled with stdio support");
+    return NULL;
+}
 #endif /* HAVE_STDIO_H */
 
 SDL_RWops *