Skip to content
Permalink
Browse files
Patched to compile on various platforms and compilers.
  • Loading branch information
icculus committed Aug 12, 2017
1 parent 7fcddfb commit cc3ac9539e42217fe0c1446a7c17fff73d43c0dd
Showing with 8 additions and 7 deletions.
  1. +3 −1 src/physfs.c
  2. +1 −2 src/physfs_platform_os2.c
  3. +4 −4 src/physfs_platform_windows.c
@@ -2445,7 +2445,9 @@ void PHYSFS_enumerateFilesCallback(const char *fname,
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 */

@@ -401,7 +401,6 @@ int __PHYSFS_platformEnumerate(const char *dirname,
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 @@ int __PHYSFS_platformEnumerate(const char *dirname,
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 */

@@ -621,9 +621,9 @@ void *__PHYSFS_platformGetThreadID(void)
} /* __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 @@ void __PHYSFS_platformEnumerate(const char *dirname,
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));

0 comments on commit cc3ac95

Please sign in to comment.