mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
Merge remote-tracking branch 'upstream/master' into RDLines
This commit is contained in:
commit
403674ebf4
15
.github/workflows/build-macos.yml
vendored
15
.github/workflows/build-macos.yml
vendored
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
return true;
|
||||
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;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
bool CheckLocalFileWritable(const std::string& name)
|
||||
|
@ -32,11 +32,16 @@ add_library(teakra
|
||||
register.h
|
||||
shared_memory.h
|
||||
teakra.cpp
|
||||
test.h
|
||||
test_generator.cpp
|
||||
test_generator.h
|
||||
)
|
||||
|
||||
if (TEAKRA_BUILD_UNIT_TESTS)
|
||||
target_sources(teakra PUBLIC
|
||||
test.h
|
||||
test_generator.cpp
|
||||
test_generator.h
|
||||
)
|
||||
endif()
|
||||
|
||||
create_target_directory_groups(teakra)
|
||||
|
||||
target_link_libraries(teakra PRIVATE Threads::Threads)
|
||||
|
Loading…
Reference in New Issue
Block a user