Merge remote-tracking branch 'upstream/master' into RDLines

This commit is contained in:
Jaklyy 2024-02-24 14:20:25 -05:00
commit 403674ebf4
4 changed files with 36 additions and 17 deletions

View File

@ -43,6 +43,7 @@ jobs:
with:
name: macOS-${{ matrix.arch }}
path: macOS-${{ matrix.arch }}.zip
retention-days: 1
universal-binary:
name: Universal binary
@ -75,10 +76,10 @@ jobs:
with:
name: macOS-universal
path: macOS-universal.zip
- name: Clean up architecture-specific artifacts
uses: geekyeggo/delete-artifact@v4
with:
failOnError: false
name: |
macOS-x86_64
macOS-arm64
# - name: Clean up architecture-specific artifacts
# uses: geekyeggo/delete-artifact@v4
# with:
# failOnError: false
# name: |
# macOS-x86_64
# macOS-arm64

View File

@ -3,11 +3,7 @@
#include "loader.h"
#include <cstdlib>
#include <cstring>
#ifdef __APPLE__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
Log_SetChannel(GL::Context);
#if defined(_WIN32)

View File

@ -31,6 +31,7 @@
#include <QMutex>
#include <QOpenGLContext>
#include <QSharedMemory>
#include <QTemporaryFile>
#include <SDL_loadso.h>
#include "Platform.h"
@ -333,13 +334,29 @@ bool LocalFileExists(const std::string& name)
bool CheckFileWritable(const std::string& filepath)
{
FileHandle* file = Platform::OpenFile(filepath.c_str(), FileMode::Append);
FileHandle* file = Platform::OpenFile(filepath.c_str(), FileMode::Read);
if (file)
{
// if the file exists, check if it can be opened for writing.
Platform::CloseFile(file);
file = Platform::OpenFile(filepath.c_str(), FileMode::Append);
if (file)
{
Platform::CloseFile(file);
return true;
}
else return false;
}
else
{
// if the file does not exist, create a temporary file to check, to avoid creating an empty file.
if (QTemporaryFile(filepath.c_str()).open())
{
return true;
}
else return false;
}
}
bool CheckLocalFileWritable(const std::string& name)

View File

@ -32,10 +32,15 @@ add_library(teakra
register.h
shared_memory.h
teakra.cpp
)
if (TEAKRA_BUILD_UNIT_TESTS)
target_sources(teakra PUBLIC
test.h
test_generator.cpp
test_generator.h
)
)
endif()
create_target_directory_groups(teakra)