Fixed Windows compile.

This commit is contained in:
casey langen 2019-01-05 00:36:28 -08:00
parent 357fec1129
commit 81ae397814
2 changed files with 6 additions and 2 deletions

View File

@ -182,12 +182,16 @@ static inline bool externalIdExists(const std::string& externalId) {
static int getLastModifiedTime(const std::string& fn) {
#ifdef WIN32
/* todo */
struct _stat result = { 0 };
std::wstring fn16 = u8to16(fn.c_str());
if (_wstat(fn16.c_str(), &result) == 0) {
return (int) result.st_mtime;
}
#else
struct stat result = { 0 };
if (stat(fn.c_str(), &result) == 0) {
return result.st_mtime;
}
#endif
return -1;
}

View File

@ -218,7 +218,7 @@ void GmeIndexerSource::ScanDirectory(
this->UpdateMetadata(fullPath8, source, indexer);
}
catch (...) {
std::string error = strfmt("error reading metadata for %s", fullFn.c_str());
std::string error = strfmt("error reading metadata for %s", fullPath8.c_str());
debug->Error(PLUGIN_NAME, error.c_str());
}
}