misc/libphyslayer/physfsrwops.c
changeset 13543 f8c0a62fa3ac
parent 11661 227718170097
child 13917 d178a834f1f4
--- a/misc/libphyslayer/physfsrwops.c	Sun Jul 22 02:29:44 2018 +0200
+++ b/misc/libphyslayer/physfsrwops.c	Sun Jul 22 02:46:27 2018 +0200
@@ -56,7 +56,7 @@
         if (current == -1)
         {
             SDL_SetError("Can't find position in file: %s",
-                          PHYSFS_getLastError());
+                          PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
             return -1;
         } /* if */
 
@@ -77,7 +77,7 @@
         const PHYSFS_sint64 len = PHYSFS_fileLength(handle);
         if (len == -1)
         {
-            SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError());
+            SDL_SetError("Can't find end of file: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
             return -1;
         } /* if */
 
@@ -98,7 +98,7 @@
 
     if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
     {
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
         return -1;
     } /* if */
 
@@ -123,7 +123,7 @@
     if (rc != ((PHYSFS_sint64) readlen))
     {
         if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
-            SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+            SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
     } /* if */
 
     #if TARGET_SDL13
@@ -145,7 +145,7 @@
     const PHYSFS_uint64 writelen = (PHYSFS_uint64) (num * size);
     const PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, writelen);
     if (rc != ((PHYSFS_sint64) writelen))
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
 
     #if TARGET_SDL13
     return (size_t) rc;
@@ -160,7 +160,7 @@
     PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
     if (!PHYSFS_close(handle))
     {
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
         return -1;
     } /* if */
 
@@ -174,7 +174,7 @@
     SDL_RWops *retval = NULL;
 
     if (handle == NULL)
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
     else
     {
         retval = SDL_AllocRW();