Adapted for multi-platform compilation

Fixed URL input could only enter numbers
This commit is contained in:
chinosk
2025-03-17 22:26:52 +00:00
parent ade47131f9
commit d83854c755
19 changed files with 291 additions and 856 deletions

View File

@@ -2,11 +2,15 @@
#include <codecvt>
#include <locale>
#include <jni.h>
#include "fmt/core.h"
extern JavaVM* g_javaVM;
#ifndef GKMS_WINDOWS
#include <jni.h>
extern JavaVM* g_javaVM;
#else
#include "cpprest/details/http_helpers.h"
#endif
namespace GakumasLocal::Misc {
@@ -20,6 +24,13 @@ namespace GakumasLocal::Misc {
return utf16conv.to_bytes(str.data(), str.data() + str.size());
}
#ifdef GKMS_WINDOWS
std::string ToUTF8(const std::wstring_view& str) {
return utility::conversions::to_utf8string(str.data());
}
#endif
#ifndef GKMS_WINDOWS
JNIEnv* GetJNIEnv() {
if (!g_javaVM) return nullptr;
JNIEnv* env = nullptr;
@@ -31,6 +42,7 @@ namespace GakumasLocal::Misc {
}
return env;
}
#endif
CSEnum::CSEnum(const std::string& name, const int value) {
this->Add(name, value);