mirror of
https://notabug.org/litucks/torzu.git
synced 2026-03-11 22:15:35 +00:00
Bug discovered via an incomplete fix in Sudachi. Some Progress Dialog callbacks pass the wrong type (Double instead of Long) from C++ to Java code causing a crash at runtime. To fix this a new function is implemented to convert to a Java Long and that is used instead of the function that converts to a Double. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/58 Co-authored-by: echosys <echosys@noreply.localhost> Co-committed-by: echosys <echosys@noreply.localhost>
29 lines
785 B
C++
29 lines
785 B
C++
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <jni.h>
|
|
#include "common/common_types.h"
|
|
|
|
namespace Common::Android {
|
|
|
|
std::string GetJString(JNIEnv* env, jstring jstr);
|
|
jstring ToJString(JNIEnv* env, std::string_view str);
|
|
jstring ToJString(JNIEnv* env, std::u16string_view str);
|
|
|
|
double GetJDouble(JNIEnv* env, jobject jdouble);
|
|
jobject ToJDouble(JNIEnv* env, double value);
|
|
|
|
s32 GetJInteger(JNIEnv* env, jobject jinteger);
|
|
jobject ToJInteger(JNIEnv* env, s32 value);
|
|
|
|
s64 GetJLong(JNIEnv* env, jobject jlong);
|
|
jobject ToJLong(JNIEnv* env, s64 value);
|
|
|
|
bool GetJBoolean(JNIEnv* env, jobject jboolean);
|
|
jobject ToJBoolean(JNIEnv* env, bool value);
|
|
|
|
} // namespace Common::Android
|