Some preparation work for new platform support.
- Added a "PSP" compile-time define to clean up some compile time checks (replaced !WIN32 && !LINUX && !IOS with PSP) -- Wil, I am aware that this is redundant with the PSPENV variable you introduced recently, I think we can clean that up easily -- This looks like lots of changes, but most of the time I just moved some blocks here and there -- tested on VC 2010, PSP, and a bit of NDK -- I might have broken maemo, iOS, or Linux compilation, can you guys check? - Fixed some warnings reported by NDK - NDK still does not compile because recent boost additions (mutex, etc...) are apparently not supported
This commit is contained in:
@@ -59,7 +59,14 @@ int WRand()
|
||||
int filesize(const char * filename)
|
||||
{
|
||||
int file_size = 0;
|
||||
#if defined (WIN32) || defined (LINUX) || defined (IOS)
|
||||
#if defined (PSP)
|
||||
int file = sceIoOpen(filename, PSP_O_RDONLY, 0777);
|
||||
if (file > 0)
|
||||
{
|
||||
file_size = sceIoLseek(file, 0, PSP_SEEK_END);
|
||||
sceIoClose(file);
|
||||
}
|
||||
#else
|
||||
FILE * file = fopen(filename, "rb");
|
||||
if (file != NULL)
|
||||
{
|
||||
@@ -67,15 +74,6 @@ int filesize(const char * filename)
|
||||
file_size = ftell(file);
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
#else
|
||||
int file = sceIoOpen(filename, PSP_O_RDONLY, 0777);
|
||||
if (file > 0)
|
||||
{
|
||||
file_size = sceIoLseek(file, 0, PSP_SEEK_END);
|
||||
sceIoClose(file);
|
||||
}
|
||||
|
||||
#endif
|
||||
return file_size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user