LuaJIT compatibility.

This commit is contained in:
jussi
2023-07-02 17:44:24 +03:00
parent 0e77452a1b
commit 8ad7254292
23 changed files with 966 additions and 53 deletions

View File

@@ -1006,13 +1006,13 @@ int lcoreLoadShaderFromMemory( lua_State *L ) {
char *fs = NULL;
if ( lua_isstring( L, 1 ) ) {
size_t vsLen = lua_rawlen( L, 1 ) + 1;
size_t vsLen = uluaGetTableLenIndex( L, 1 ) + 1;
vs = malloc( vsLen * sizeof( char ) );
strcpy( vs, lua_tostring( L, 1 ) );
}
if ( lua_isstring( L, 2 ) ) {
size_t fsLen = lua_rawlen( L, 2 ) + 1;
size_t fsLen = uluaGetTableLenIndex( L, 2 ) + 1;
fs = malloc( fsLen * sizeof( char ) );
strcpy( fs, lua_tostring( L, 2 ) );