Various NX build fixes

This commit is contained in:
2018-09-23 19:12:29 -07:00
parent 5306525029
commit 80c283736e
3 changed files with 16 additions and 8 deletions

View File

@@ -7,6 +7,8 @@
#include "osx_largefilewrapper.h"
#endif
#include <unistd.h>
namespace athena::io
{
FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr)
@@ -82,6 +84,10 @@ void FileWriter::close()
m_fileHandle = NULL;
std::string tmpFilename = m_filename + '~';
#ifdef __SWITCH__
/* Due to Horizon not being a fully POSIX compatible OS, we need to make sure the file *does not* exist before attempting to rename */
unlink(m_filename.c_str());
#endif
rename(tmpFilename.c_str(), m_filename.c_str());
}