forked from len0rd/rockbox
Add some app_*() wrappers for file IO functions to make app_ work the same as sim_, thereby fixing application builds
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28993 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e8e6a3c873
commit
42ad21ab53
1 changed files with 47 additions and 1 deletions
|
|
@ -59,12 +59,58 @@
|
|||
#include "usbstack/usb_hid.h"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_PLATFORM & PLATFORM_SDL)
|
||||
#if defined (SIMULATOR)
|
||||
#define PREFIX(_x_) sim_ ## _x_
|
||||
#elif defined (APPLICATION)
|
||||
#define PREFIX(_x_) app_ ## _x_
|
||||
#else
|
||||
#define PREFIX
|
||||
#endif
|
||||
|
||||
#if defined (APPLICATION)
|
||||
/* For symmetry reasons (we want app_ and sim_ to behave similarly), some
|
||||
* wrappers are needed */
|
||||
static int app_close(int fd)
|
||||
{
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
static ssize_t app_read(int fd, void *buf, size_t count)
|
||||
{
|
||||
return read(fd,buf,count);
|
||||
}
|
||||
|
||||
static off_t app_lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
return lseek(fd,offset,whence);
|
||||
}
|
||||
|
||||
static ssize_t app_write(int fd, const void *buf, size_t count)
|
||||
{
|
||||
return write(fd,buf,count);
|
||||
}
|
||||
|
||||
static int app_ftruncate(int fd, off_t length)
|
||||
{
|
||||
return ftruncate(fd,length);
|
||||
}
|
||||
|
||||
static off_t app_filesize(int fd)
|
||||
{
|
||||
return filesize(fd);
|
||||
}
|
||||
|
||||
static int app_closedir(DIR *dirp)
|
||||
{
|
||||
return closedir(dirp);
|
||||
}
|
||||
|
||||
static struct dirent *app_readdir(DIR *dirp)
|
||||
{
|
||||
return readdir(dirp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_PLUGIN_CHECK_OPEN_CLOSE) && (MAX_OPEN_FILES>32)
|
||||
#warning "MAX_OPEN_FILES>32, disabling plugin file open/close checking"
|
||||
#undef HAVE_PLUGIN_CHECK_OPEN_CLOSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue