summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjussi2023-07-02 17:44:24 +0300
committerjussi2023-07-02 17:44:24 +0300
commit8ad725429292be22086d51df285907742be7a91a (patch)
tree41c13c146bb3f3f82ade36c2518d105a72b2a5dc /src
parent0e77452a1b4f894e342dae5583f8b02f915e8f6d (diff)
downloadreilua-enhanced-8ad725429292be22086d51df285907742be7a91a.tar.gz
reilua-enhanced-8ad725429292be22086d51df285907742be7a91a.tar.bz2
reilua-enhanced-8ad725429292be22086d51df285907742be7a91a.zip
LuaJIT compatibility.
Diffstat (limited to 'src')
-rw-r--r--src/core.c4
-rw-r--r--src/main.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/src/core.c b/src/core.c
index 6c8e7a1..ab65626 100644
--- a/src/core.c
+++ b/src/core.c
@@ -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 ) );
diff --git a/src/main.c b/src/main.c
index 0064b48..4b90b08 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,6 +9,14 @@ inline static void printVersion() {
else {
TraceLog( LOG_INFO, "ReiLua %d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );
}
+
+#ifdef LUA_VERSION
+ TraceLog( LOG_INFO, "%s", LUA_VERSION );
+#endif
+
+#ifdef LUAJIT_VERSION
+ TraceLog( LOG_INFO, "%s", LUAJIT_VERSION );
+#endif
}
int main( int argn, const char **argc ) {
@@ -21,9 +29,7 @@ int main( int argn, const char **argc ) {
return 1;
}
else if ( strcmp( argc[1], "--help" ) == 0 || strcmp( argc[1], "-h" ) == 0 ) {
- printf(
-"Usage: ReiLua [Options] [Directory to main.lua or main]\nOptions:\n-h --help\tThis help\n-v --version\tShow ReiLua version\n-i --interpret\tInterpret mode [File name]\n" );
-
+ printf( "Usage: ReiLua [Options] [Directory to main.lua or main]\nOptions:\n-h --help\tThis help\n-v --version\tShow ReiLua version\n-i --interpret\tInterpret mode [File name]\n" );
return 1;
}
else if ( strcmp( argc[1], "--interpret" ) == 0 || strcmp( argc[1], "-i" ) == 0 ) {