Skip to content

Commit

Permalink
fix(android): fix build and 'Runtime::isPermissionAllowed'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Sep 28, 2023
1 parent b166246 commit 2cc849d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/generate-compile-flags-txt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ while (( $# > 0 )); do
done

function generate () {
local cflags=($("$root/bin/cflags.sh" "${args[@]}") -ferror-limit=0 -I"$root/src")
local cflags=($("$root/bin/cflags.sh" "${args[@]}") -ferror-limit=0 -I"$root/src" -U__APPLE__)

for flag in "${cflags[@]}"; do
echo "$flag"
Expand Down
1 change: 1 addition & 0 deletions src/android/internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ namespace SSC::android {

Runtime (JNIEnv* env, jobject self, String rootDirectory);
~Runtime ();
bool isPermissionAllowed (const String&) const;
};

class Bridge : public IPC::Bridge {
Expand Down
2 changes: 1 addition & 1 deletion src/android/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace SSC::android {
this->rootDirectory = rootDirectory;
}

bool isPermissionAllowed (const String& name) {
bool Runtime::isPermissionAllowed (const String& name) const {
static const auto config = SSC::getUserConfig();
const auto permission = String("permissions_allow_") + name;

Expand Down
8 changes: 4 additions & 4 deletions src/common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ static os_log_t SSC_OS_LOG_DEBUG_BUNDLE = nullptr;
#define ToString(string) String(string)

namespace SSC {
#if !(defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_SIMULATOR)
namespace fs = std::filesystem;
using Path = fs::path;
#endif

using String = std::string;
using StringStream = std::stringstream;
using WString = std::wstring;
using WStringStream = std::wstringstream;
#if !TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR
using Path = fs::path;
#endif

template <typename T> using Queue = std::queue<T>;
template <typename T> using Vector = std::vector<T>;
Expand Down Expand Up @@ -682,7 +682,7 @@ namespace SSC {
notifyCli();
}

#if !TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR
#if !(defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_SIMULATOR)
inline String readFile (fs::path path) {
if (fs::is_directory(path)) {
stdWrite("WARNING: trying to read a directory as a file: " + path.string(), true);
Expand Down

0 comments on commit 2cc849d

Please sign in to comment.