project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c
changeset 10017 de822cd3df3a
parent 6619 229b99faf580
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    43 
    43 
    44 #ifdef __WIN32__
    44 #ifdef __WIN32__
    45 
    45 
    46 /* Functions to read/write Win32 API file pointers */
    46 /* Functions to read/write Win32 API file pointers */
    47 /* Will not use it on WinCE because stdio is buffered, it means
    47 /* Will not use it on WinCE because stdio is buffered, it means
    48    faster, and all stdio functions anyway are embedded in coredll.dll - 
    48    faster, and all stdio functions anyway are embedded in coredll.dll -
    49    the main wince dll*/
    49    the main wince dll*/
    50 
    50 
    51 #include "../core/windows/SDL_windows.h"
    51 #include "../core/windows/SDL_windows.h"
    52 
    52 
    53 #ifndef INVALID_SET_FILE_POINTER
    53 #ifndef INVALID_SET_FILE_POINTER
    54 #define INVALID_SET_FILE_POINTER 0xFFFFFFFF
    54 #define INVALID_SET_FILE_POINTER 0xFFFFFFFF
    55 #endif
    55 #endif
    56 
    56 
    57 #define READAHEAD_BUFFER_SIZE	1024
    57 #define READAHEAD_BUFFER_SIZE   1024
    58 
    58 
    59 static int SDLCALL
    59 static int SDLCALL
    60 windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
    60 windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
    61 {
    61 {
    62 #ifndef _WIN32_WCE
    62 #ifndef _WIN32_WCE
   471     rwops->read = windows_file_read;
   471     rwops->read = windows_file_read;
   472     rwops->write = windows_file_write;
   472     rwops->write = windows_file_write;
   473     rwops->close = windows_file_close;
   473     rwops->close = windows_file_close;
   474 
   474 
   475 #elif HAVE_STDIO_H
   475 #elif HAVE_STDIO_H
   476 	#ifdef __APPLE__
   476     #ifdef __APPLE__
   477 	fp = SDL_OpenFPFromBundleOrFallback(file, mode);
   477     fp = SDL_OpenFPFromBundleOrFallback(file, mode);
   478     #else
   478     #else
   479 	fp = fopen(file, mode);
   479     fp = fopen(file, mode);
   480 	#endif
   480     #endif
   481 	if (fp == NULL) {
   481     if (fp == NULL) {
   482         SDL_SetError("Couldn't open %s", file);
   482         SDL_SetError("Couldn't open %s", file);
   483     } else {
   483     } else {
   484         rwops = SDL_RWFromFP(fp, 1);
   484         rwops = SDL_RWFromFP(fp, 1);
   485     }
   485     }
   486 #else
   486 #else