From b8c0e78c9187b66adf75c37e89e50320347886e1 Mon Sep 17 00:00:00 2001 From: raa-eruanna Date: Sat, 19 Aug 2017 17:32:10 -0400 Subject: [PATCH] - fix linux compile --- src/d_iwad.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 1db1981bf..0de62ce77 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -414,6 +414,12 @@ 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; @@ -426,18 +432,18 @@ void FIWadManager::AddIWADCandidates(const char *dir) { if (!(I_FindAttr(&findstate) & FA_DIREC)) { - auto p = strrchr(findstate.Name, '.'); + auto p = strrchr(ENTRYNAME, '.'); if (p != nullptr) { // special IWAD extension. if (!stricmp(p, ".iwad") || !stricmp(p, ".ipk3") || !stricmp(p, "ipk7")) { - mFoundWads.Push(FFoundWadInfo{ slasheddir + findstate.Name, "", -1 }); + mFoundWads.Push(FFoundWadInfo{ slasheddir + ENTRYNAME, "", -1 }); } } for (auto &name : mIWadNames) { - if (!stricmp(name, findstate.Name)) + if (!stricmp(name, ENTRYNAME)) { mFoundWads.Push(FFoundWadInfo{ slasheddir + name, "", -1 }); } @@ -744,4 +750,4 @@ const FIWADInfo *FIWadManager::FindIWAD(TArray &wadfiles, const char *i } I_SetIWADInfo(); return iwad_info; -} \ No newline at end of file +}