Fix build with Clang on Windows

This commit is contained in:
Mat Sutcliffe
2020-08-26 21:31:52 +01:00
parent b80114213d
commit bb8aeaa3d0
10 changed files with 56 additions and 21 deletions

View File

@@ -71,6 +71,16 @@ namespace BlackMisc
return ok;
}
CAtomicFile::~CAtomicFile()
{
#if __cplusplus >= 201700L
const bool ex = std::uncaught_exceptions() > 0;
#else
const bool ex = std::uncaught_exception();
#endif
if (ex) { QFile::close(); }
}
void CAtomicFile::close()
{
if (! isOpen()) { return; }