Patched to compile on various platforms and compilers.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 12 Aug 2017 03:10:19 -0400
changeset 1564 62c27f6efeed
parent 1563 4633843067dc
child 1565 91f2e5526d22
Patched to compile on various platforms and compilers.
src/physfs.c
src/physfs_platform_os2.c
src/physfs_platform_windows.c
--- a/src/physfs.c	Sat Aug 12 03:06:06 2017 -0400
+++ b/src/physfs.c	Sat Aug 12 03:10:19 2017 -0400
@@ -2445,7 +2445,9 @@
                                    PHYSFS_EnumFilesCallback callback,
                                    void *data)
 {
-    LegacyEnumFilesCallbackData cbdata = { callback, data };
+    LegacyEnumFilesCallbackData cbdata;
+    cbdata.callback = callback;
+    cbdata.data = data;
     (void) PHYSFS_enumerate(fname, enumFilesCallbackAlwaysSucceed, &cbdata);
 } /* PHYSFS_enumerateFilesCallback */
 
--- a/src/physfs_platform_os2.c	Sat Aug 12 03:06:06 2017 -0400
+++ b/src/physfs_platform_os2.c	Sat Aug 12 03:10:19 2017 -0400
@@ -401,7 +401,6 @@
     HDIR hdir = HDIR_CREATE;
     ULONG count = 1;
     APIRET rc;
-    int cbrc;
     int retval = 1;
 
     BAIL_IF(!utf8, PHYSFS_ERR_OUT_OF_MEMORY, -1);
@@ -436,7 +435,7 @@
                 retval = callback(callbackdata, origdir, utf8);
                 allocator.Free(utf8);
                 if (retval == -1)
-                    PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK);
+                    PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK);
             } /* else */
         } /* if */
 
--- a/src/physfs_platform_windows.c	Sat Aug 12 03:06:06 2017 -0400
+++ b/src/physfs_platform_windows.c	Sat Aug 12 03:10:19 2017 -0400
@@ -621,9 +621,9 @@
 } /* __PHYSFS_platformGetThreadID */
 
 
-void __PHYSFS_platformEnumerate(const char *dirname,
-                                PHYSFS_EnumerateCallback callback,
-                                const char *origdir, void *callbackdata)
+int __PHYSFS_platformEnumerate(const char *dirname,
+                               PHYSFS_EnumerateCallback callback,
+                               const char *origdir, void *callbackdata)
 {
     HANDLE dir = INVALID_HANDLE_VALUE;
     WIN32_FIND_DATAW entw;
@@ -676,7 +676,7 @@
             retval = callback(callbackdata, origdir, utf8);
             allocator.Free(utf8);
             if (retval == -1)
-                PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK);
+                PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK);
         } /* else */
     } while ((retval == 1) && (FindNextFileW(dir, &entw) != 0));