1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-20 23:29:27 +08:00

add: migrate source code of luahook

This commit is contained in:
0O0o0oOoO00
2025-11-01 00:23:46 +08:00
parent 753e676152
commit 41505d6e91
520 changed files with 154475 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#include "./PlatformThread.h"
namespace zz {
int OSThread::GetThreadLocalInt(LocalStorageKey key) {
return static_cast<int>(reinterpret_cast<intptr_t>(GetThreadLocal(key)));
}
void OSThread::SetThreadLocalInt(LocalStorageKey key, int value) {
SetThreadLocal(key, reinterpret_cast<void *>(static_cast<intptr_t>(value)));
}
bool OSThread::HasThreadLocal(LocalStorageKey key) {
return GetThreadLocal(key) != nullptr;
}
void *OSThread::GetExistingThreadLocal(LocalStorageKey key) {
return GetThreadLocal(key);
}
} // namespace zz