微信小程序编译
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s

This commit is contained in:
2026-04-19 00:16:03 +08:00
parent 4c78ed674c
commit 0d6faa56f4
646 changed files with 140709 additions and 12 deletions

View File

@@ -0,0 +1,141 @@
#include "lua_adaptor_import.h"
#if LUA_VERSION_NUM == 501
static TValue* lua_index2addr(lua_State* L, int idx)
{
CallInfo* ci = L->ci;
if (idx > 0)
{
TValue* o = ci->func + idx;
// api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index");
if (o >= L->top) return NONVALIDVALUE;
else return o;
}
else if (!ispseudo(idx))
{
/* negative index */
// api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
return L->top + idx;
}
else if (idx == LUA_REGISTRYINDEX)
return &G(L)->l_registry;
else
{
/* upvalues */
idx = LUA_REGISTRYINDEX - idx;
// api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
if (iscfunction(ci->func))
return NONVALIDVALUE;
else
{
CClosure* func = &ci->func->value.gc->cl.c;
return (idx <= func->nupvalues) ? &func->upvalue[idx - 1] : NONVALIDVALUE;
}
}
}
size_t lua_sizeof(lua_State* L, int idx){
const char* tn = lua_typename(L, lua_type(L, -1));
TValue* o = lua_index2addr(L, idx);
if (!o)
return 0;
switch (ttype(o))
{
case LUA_TTABLE:
{
luaL_checkstack(L, LUA_MINSTACK, NULL);
Table* h = hvalue(o);
if (h == NULL) {
return 0;
}
return (sizeof(Table) + sizeof(TValue) * h->sizearray +
sizeof(Node) * (sizenode(h)));
}
case LUA_TFUNCTION:
{
if (iscfunction(o)) {
return sizeCclosure(o->value.gc->cl.c.nupvalues);
} else {
return sizeLclosure(o->value.gc->cl.l.nupvalues);
}
}
case LUA_TTHREAD:
{
lua_State* th = thvalue(o);
return (sizeof(lua_State) + sizeof(TValue) * th->stacksize +
sizeof(CallInfo) * th->size_ci);
}
case LUA_TPROTO:
{
Proto* p = (Proto*)pvalue(o);
return (sizeof(Proto) +
sizeof(Instruction) * p->sizecode +
sizeof(Proto*) * p->sizep +
sizeof(TValue) * p->sizek +
sizeof(int) * p->sizelineinfo +
sizeof(LocVar) * p->sizelocvars +
sizeof(TString*) * p->sizeupvalues);
}
case LUA_TUSERDATA:
{
return sizeudata(uvalue(o));
}
case LUA_TSTRING:
{
TString* ts = &o->value.gc->ts;
return sizeof(TString) + sizeof(char) * ts->tsv.len + 1;
}
case LUA_TNUMBER:
{
return sizeof(lua_Number);
}
case LUA_TBOOLEAN:
{
return sizeof(int);
}
case LUA_TLIGHTUSERDATA:
{
return sizeof(void*);
}
default: return (size_t)(0);
}
}
uintptr_t lua_getaddr(lua_State* L, int idx) {
TValue* o = lua_index2addr(L, idx);
if (!o)
return (uintptr_t)(lua_topointer(L, -1));
switch (ttype(o))
{
case LUA_TPROTO:
{
return (uintptr_t)(pvalue(o));
}
case LUA_TSTRING:
{
return (uintptr_t)(getstr(o));
}
case LUA_TTABLE:
case LUA_TFUNCTION:
case LUA_TTHREAD:
case LUA_TUSERDATA:
case LUA_TLIGHTUSERDATA:
default: {
return (uintptr_t)(lua_topointer(L, -1));
}
}
}
int (lua_getuservalue) (lua_State *L, int idx) {
lua_pushnil(L);
}
#endif

View File

@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 8c789840c26c9134cbee077ec7f98e19
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,161 @@
#include "lua_adaptor_import.h"
#if LUA_VERSION_NUM == 503
#define GETTVALUE(v) v
#define tvtype(o) ttnov(o)
#define LUA_PROTO LUA_TPROTO
#define LUA_UPVAL LUA_TUPVAL
#define LUA_TABLE LUA_TTABLE
#define LUA_THREAD LUA_TTHREAD
#define LUA_USERDATA LUA_TUSERDATA
#define LUA_LIGHTUSERDATA LUA_TLIGHTUSERDATA
#define LUA_SHRSTR LUA_TSHRSTR
#define LUA_LNGSTR LUA_TLNGSTR
#define LUA_LCL LUA_TLCL
#define LUA_CCL LUA_TCCL
#define LUA_LCF LUA_TLCF
#define LUA_IS_LUA_C_FUNCTION(f) (ttislcf(f))
#define LUA_C_CLUSTER_VALUE(f) (clCvalue(f))
static TValue* lua_index2addr(lua_State* L, int idx)
{
CallInfo* ci = L->ci;
if (idx > 0)
{
TValue* o = GETTVALUE(ci->func + idx);
api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index");
if (o >= GETTVALUE(L->top)) return NONVALIDVALUE;
else return o;
}
else if (!ispseudo(idx))
{
/* negative index */
api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
return GETTVALUE(L->top + idx);
}
else if (idx == LUA_REGISTRYINDEX)
return &G(L)->l_registry;
else
{
/* upvalues */
idx = LUA_REGISTRYINDEX - idx;
api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
if (LUA_IS_LUA_C_FUNCTION(GETTVALUE(ci->func)))
return NONVALIDVALUE;
else
{
CClosure* func = LUA_C_CLUSTER_VALUE(GETTVALUE(ci->func));
return (idx <= func->nupvalues) ? &func->upvalue[idx - 1] : NONVALIDVALUE;
}
}
}
uintptr_t lua_getaddr(lua_State* L, int idx) {
TValue* o = lua_index2addr(L, idx);
if (!o)
return (uintptr_t)(lua_topointer(L, -1));
switch (tvtype(o))
{
case LUA_TPROTO:
{
return (uintptr_t)(pvalue(o));
}
case LUA_SHRSTR:
case LUA_LNGSTR:
{
return (uintptr_t)(tsvalue(o));
}
case LUA_TTABLE:
case LUA_LCL:
case LUA_CCL:
case LUA_LCF:
case LUA_TTHREAD:
case LUA_TUSERDATA:
case LUA_TLIGHTUSERDATA:
default: {
return (uintptr_t)(lua_topointer(L, -1));
}
}
}
size_t lua_sizeof(lua_State* L, int idx){
const char* tn = lua_typename(L, lua_type(L, -1));
TValue* o = lua_index2addr(L, idx);
if (!o)
return 0;
switch (tvtype(o))
{
case LUA_TABLE:
{
luaL_checkstack(L, LUA_MINSTACK, NULL);
Table* h = hvalue(o);
if (h == NULL) {
return 0;
}
return (sizeof(Table) + sizeof(TValue) * h->sizearray +
sizeof(Node) * (isdummy(h) ? 0 : sizenode(h)));
}
case LUA_LCL:
{
LClosure* cl = clLvalue(o);
return sizeLclosure(cl->nupvalues);
}
case LUA_CCL:
{
CClosure* cl = clCvalue(o);
return sizeCclosure(cl->nupvalues);
}
case LUA_TTHREAD:
{
lua_State* th = thvalue(o);
return (sizeof(lua_State) + sizeof(TValue) * th->stacksize +
sizeof(CallInfo) * th->nci);
}
case LUA_PROTO:
{
Proto* p = (Proto*)pvalue(o);
return (sizeof(Proto) +
sizeof(Instruction) * p->sizecode +
sizeof(Proto*) * p->sizep +
sizeof(TValue) * p->sizek +
sizeof(int) * p->sizelineinfo +
sizeof(LocVar) * p->sizelocvars +
sizeof(TString*) * p->sizeupvalues);
}
case LUA_USERDATA:
{
return sizeudata(uvalue(o));
}
case LUA_SHRSTR:
{
TString* ts = gco2ts(o);
return sizelstring(ts->shrlen);
}
case LUA_LNGSTR:
{
TString* ts = gco2ts(o);
return sizelstring(ts->u.lnglen);
}
case LUA_TNUMBER:
{
return sizeof(lua_Number);
}
case LUA_TBOOLEAN:
{
return sizeof(int);
}
case LUA_LIGHTUSERDATA:
{
return sizeof(void*);
}
default: return (size_t)(0);
}
}
#endif

View File

@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 2f1fcd99beb118d4e9407b9475547d70
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
#include "lua_adaptor_import.h"
#include <emscripten/emscripten.h>
lua_Debug* lua_newdebugar() { return malloc(sizeof(lua_Debug)); }
void lua_deletedebugar(lua_Debug* ar) { return free(ar); }
const char* lua_Debug_getname(lua_Debug* ar) { return ar->name; }
char* lua_Debug_getshortsrc(lua_Debug* ar) { return ar->short_src; }
int lua_Debug_getevent(lua_Debug* ar) { return ar->event; }
int lua_Debug_getlinedefined(lua_Debug* ar) { return ar->linedefined; }
int lua_Debug_getlastlinedefined(lua_Debug* ar) { return ar->lastlinedefined; }
int lua_get_registry_index() { return LUA_REGISTRYINDEX; }
double lua_todouble(lua_State *L, int idx) { return (double)lua_tonumber(L, idx); }
lua_State* lua_State_getmainthread(lua_State* L) { return G(L)->mainthread; }
void (lua_do_sethook) (lua_State *L, lua_Hook func, int mask, int count) {
lua_sethook(L, func, mask, count);
}
extern void SetLuaState(lua_State* L);
EMSCRIPTEN_KEEPALIVE lua_State* invoke_lua_newstate_with_wx_perf_callback(lua_Alloc f, void *ud) {
lua_State* L;
L = lua_newstate(f, ud);
SetLuaState(L);
return L;
}

View File

@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: bb7506df297f8eb41821ba109f04a253
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
#pragma once
#include "stdint.h"
#include <stdlib.h>
/* value at a non-valid index */
#define NONVALIDVALUE NULL//cast(TValue *, luaO_nilobject)
/* test for pseudo index */
#define ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
#if LOCAL_DEBUG_USE_LUA_VERSION == 503
#include "lua53/lua.h"
#include "lua53/lobject.h"
#include "lua53/lstate.h"
#include "lua53/lfunc.h"
#include "lua53/lapi.h"
#include "lua53/lstring.h"
#include "lua53/ltable.h"
#include "lua53/lauxlib.h"
#elif LOCAL_DEBUG_USE_LUA_VERSION == 501
#include "lua51/lua.h"
#include "lua51/lobject.h"
#include "lua51/lstate.h"
#include "lua51/lfunc.h"
#include "lua51/lapi.h"
#include "lua51/lstring.h"
#include "lua51/ltable.h"
#include "lua51/lauxlib.h"
#elif __EMSCRIPTEN__
//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_START
//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_END
#endif

View File

@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 5cd45b6232a7d2e458c0cb28e572c703
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant: