More windows fixes

This commit is contained in:
Phillip 2016-01-23 22:44:17 -08:00
parent 9114be2a4d
commit 0819101986
3 changed files with 23 additions and 11 deletions

View File

@ -104,9 +104,9 @@ int main(int argc, char* argv[])
printf("\n");
}
if (bytes != -1)
printf("\r%s %" PRISize " B", name.c_str(), bytes);
NOD::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes);
else
printf("\r%s", name.c_str());
NOD::Printf(_S("\r%s"), name.c_str());
fflush(stdout);
};
@ -157,9 +157,9 @@ int main(int argc, char* argv[])
printf("\n");
}
if (bytes != -1)
printf("\r%s %" PRISize " B", name.c_str(), bytes);
NOD::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes);
else
printf("\r%s", name.c_str());
NOD::Printf(_S("\r%s"), name.c_str());
fflush(stdout);
};

View File

@ -287,6 +287,18 @@ static inline int FSeek(FILE* fp, int64_t offset, int whence)
#endif
}
static inline void Printf(const SystemChar* fmt, ...)
{
va_list args;
va_start(args, fmt);
#if NOD_UCS2
vwprintf(fmt, args);
#else
vprintf(fmt, args);
#endif
va_end(args);
}
}
#endif // __NOD_UTIL_HPP__

View File

@ -168,19 +168,19 @@ static bool IsSystemFile(const SystemString& name)
if (name.size() < 4)
return false;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".dol")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".dol")))
return true;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".rel")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".rel")))
return true;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".rso")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".rso")))
return true;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".sel")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".sel")))
return true;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".bnr")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".bnr")))
return true;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".elf")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".elf")))
return true;
if (!StrCaseCmp((&*name.cend()) - 4, _S(".wad")))
if (!StrCaseCmp((&*(name.cend() - 4)), _S(".wad")))
return true;
return false;