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