Browse Source

sys: don’t use fopen on the PS3.

legacy
Sam Hocevar sam 11 years ago
parent
commit
03d135f06d
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      src/sys/file.cpp

+ 8
- 4
src/sys/file.cpp View File

@@ -23,7 +23,8 @@ class FileData


void Open(String const &file, FileAccess mode) void Open(String const &file, FileAccess mode)
{ {
#if HAVE_STDIO_H
#if __CELLOS_LV2__
#elif HAVE_STDIO_H
/* FIXME: no modes, no error checking, no nothing */ /* FIXME: no modes, no error checking, no nothing */
m_fd = fopen(file.C(), "r"); m_fd = fopen(file.C(), "r");
#endif #endif
@@ -32,7 +33,8 @@ class FileData
String ReadString() String ReadString()
{ {
String ret; String ret;
#if HAVE_STDIO_H
#if __CELLOS_LV2__
#elif HAVE_STDIO_H
while (!feof(m_fd)) while (!feof(m_fd))
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
@@ -50,12 +52,14 @@ class FileData


void Close() void Close()
{ {
#if HAVE_STDIO_H
#if __CELLOS_LV2__
#elif HAVE_STDIO_H
fclose(m_fd); fclose(m_fd);
#endif #endif
} }


#if HAVE_STDIO_H
#if __CELLOS_LV2__
#elif HAVE_STDIO_H
FILE *m_fd; FILE *m_fd;
#endif #endif
Atomic<int> m_refcount; Atomic<int> m_refcount;


Loading…
Cancel
Save