From b7d26b3fa129e2b3df8cd5c4ad57b6c3f345c1ae Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 19 Aug 2017 22:10:45 -0400 Subject: [PATCH] - fixed Linux IWAD search thanks to a suggestion by Chris on the forum. Moved the search macros to i_system.h for both platforms. Neither are compatible with the other. This can be improved upon later, but for now, at least the major compile issue is fixed. --- src/d_iwad.cpp | 12 +++--------- src/posix/i_system.h | 3 +++ src/win32/i_system.h | 3 +++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 0de62ce771..cc3f1179e1 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -414,12 +414,6 @@ void FIWadManager::CollectSearchPaths() // //========================================================================== -#ifdef _WIN32 -#define ENTRYNAME findstate.Name -#else -#define ENTRYNAME findstate.namelist[0]->d_name -#endif - void FIWadManager::AddIWADCandidates(const char *dir) { void *handle; @@ -432,18 +426,18 @@ void FIWadManager::AddIWADCandidates(const char *dir) { if (!(I_FindAttr(&findstate) & FA_DIREC)) { - auto p = strrchr(ENTRYNAME, '.'); + auto p = strrchr(FS_ENTRYNAME, '.'); if (p != nullptr) { // special IWAD extension. if (!stricmp(p, ".iwad") || !stricmp(p, ".ipk3") || !stricmp(p, "ipk7")) { - mFoundWads.Push(FFoundWadInfo{ slasheddir + ENTRYNAME, "", -1 }); + mFoundWads.Push(FFoundWadInfo{ slasheddir + FS_ENTRYNAME, "", -1 }); } } for (auto &name : mIWadNames) { - if (!stricmp(name, ENTRYNAME)) + if (!stricmp(name, FS_ENTRYNAME)) { mFoundWads.Push(FFoundWadInfo{ slasheddir + name, "", -1 }); } diff --git a/src/posix/i_system.h b/src/posix/i_system.h index d56d53e2d4..f6d976df6c 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -178,4 +178,7 @@ static inline char *strlwr(char *str) return str; } +// for the IWAD handling +#define FS_ENTRYNAME findstate.namelist[findstate.current]->d_name + #endif diff --git a/src/win32/i_system.h b/src/win32/i_system.h index 2ddb7dff4c..ab8b6c9b4c 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -193,4 +193,7 @@ int I_FindClose (void *handle); #define FA_DIREC 0x00000010 #define FA_ARCH 0x00000020 +// for the IWAD handling +#define FS_ENTRYNAME findstate.Name + #endif