Windows fixes

This commit is contained in:
Jack Andersen 2017-10-29 21:29:07 -10:00
parent 337e087182
commit 3e18e519ce
4 changed files with 11 additions and 4 deletions

View File

@ -10,6 +10,8 @@
#ifndef _WIN32 #ifndef _WIN32
#include <unistd.h> #include <unistd.h>
#include <termios.h> #include <termios.h>
#else
#include <conio.h>
#endif #endif
#include "hecl/Database.hpp" #include "hecl/Database.hpp"

2
hecl/extern/athena vendored

@ -1 +1 @@
Subproject commit 57e5196e726a4a53d55057130554cac812a40a61 Subproject commit a5056960ed063a213596b3745b67269693ed9021

View File

@ -301,7 +301,8 @@ static inline int64_t FTell(FILE* fp)
static inline int Rename(const SystemChar* oldpath, const SystemChar* newpath) static inline int Rename(const SystemChar* oldpath, const SystemChar* newpath)
{ {
#if HECL_UCS2 #if HECL_UCS2
return _wrename(oldpath, newpath); //return _wrename(oldpath, newpath);
return ReplaceFileW(newpath, oldpath, nullptr, 0, nullptr, nullptr) == 0;
#else #else
return rename(oldpath, newpath); return rename(oldpath, newpath);
#endif #endif

View File

@ -186,7 +186,8 @@ bool Project::ConfigFile::unlockAndCommit()
else else
{ {
#if HECL_UCS2 #if HECL_UCS2
_wrename(newPath.c_str(), m_filepath.c_str()); //_wrename(newPath.c_str(), m_filepath.c_str());
ReplaceFileW(m_filepath.c_str(), newPath.c_str(), nullptr, 0, nullptr, nullptr);
#else #else
rename(newPath.c_str(), m_filepath.c_str()); rename(newPath.c_str(), m_filepath.c_str());
#endif #endif
@ -529,7 +530,10 @@ bool Project::packagePath(const ProjectPath& path, FProgress progress, bool fast
} }
} }
if (specEntry && (!m_lastPackageSpec || m_lastPackageSpec->getDataSpecEntry() != specEntry)) if (!specEntry)
LogModule.report(logvisor::Fatal, "No matching DataSpec");
if (!m_lastPackageSpec || m_lastPackageSpec->getDataSpecEntry() != specEntry)
m_lastPackageSpec = std::unique_ptr<IDataSpec>(specEntry->m_factory(*this, DataSpecTool::Package)); m_lastPackageSpec = std::unique_ptr<IDataSpec>(specEntry->m_factory(*this, DataSpecTool::Package));
if (m_lastPackageSpec->canPackage(path)) if (m_lastPackageSpec->canPackage(path))