forked from redo/BlockLua
Compare commits
4 Commits
master
...
c017e14084
| Author | SHA1 | Date | |
|---|---|---|---|
| c017e14084 | |||
| 74745108b6 | |||
| ac2a1ef1ba | |||
| 279361f241 |
Binary file not shown.
BIN
BlockLua.dll
BIN
BlockLua.dll
Binary file not shown.
@@ -9,5 +9,3 @@ g++ src/bllua4.cpp %buildargs% -o BlockLua.dll && g++ -DBLLUA_UNSAFE src/bllua4.
|
||||
|
||||
rem objdump -d BlockLua.dll > BlockLua.dll.dump.txt
|
||||
rem objdump -d BlockLua-Unsafe.dll > BlockLua-Unsafe.dll.dump.txt
|
||||
|
||||
pause
|
||||
|
||||
26
compile.sh
Normal file
26
compile.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# BlockLua build script for MSYS2/MinGW32
|
||||
#
|
||||
# Usage:
|
||||
# 1. Open the MSYS2 MinGW32 shell.
|
||||
# 2. Install the required compiler with:
|
||||
# pacman -S mingw-w64-i686-gcc
|
||||
# 3. Run this script:
|
||||
# ./compile.sh
|
||||
#
|
||||
# If your MSYS2 installation is not on C:, adjust the g++ path below as needed.
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
buildargs="-Wall -Werror -m32 -shared -Isrc -Iinc/tsfuncs -Iinc/lua -lpsapi -L. -llua5.1 -static-libgcc -static-libstdc++"
|
||||
|
||||
set -x
|
||||
/mingw32/bin/g++ src/bllua4.cpp $buildargs -o BlockLua.dll && /mingw32/bin/g++ -DBLLUA_UNSAFE src/bllua4.cpp $buildargs -o BlockLua-Unsafe.dll
|
||||
set +x
|
||||
|
||||
# objdump -d BlockLua.dll > BlockLua.dll.dump.txt
|
||||
# objdump -d BlockLua-Unsafe.dll > BlockLua-Unsafe.dll.dump.txt
|
||||
@@ -38,7 +38,7 @@ end
|
||||
-- chains a bunch of filters together
|
||||
-- (thanks to Wim Couwenberg)
|
||||
function filter.chain(...)
|
||||
local n = table.getn(arg)
|
||||
local n = #arg
|
||||
local top, index = 1, 1
|
||||
local retry = ""
|
||||
return function(chunk)
|
||||
|
||||
@@ -254,7 +254,7 @@ function parse_path(path)
|
||||
path = path or ""
|
||||
--path = string.gsub(path, "%s", "")
|
||||
string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end)
|
||||
for i = 1, table.getn(parsed) do
|
||||
for i = 1, #parsed do
|
||||
parsed[i] = unescape(parsed[i])
|
||||
end
|
||||
if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end
|
||||
@@ -272,7 +272,7 @@ end
|
||||
-----------------------------------------------------------------------------
|
||||
function build_path(parsed, unsafe)
|
||||
local path = ""
|
||||
local n = table.getn(parsed)
|
||||
local n = #parsed
|
||||
if unsafe then
|
||||
for i = 1, n-1 do
|
||||
path = path .. parsed[i]
|
||||
|
||||
@@ -653,7 +653,7 @@ function bl.unhook(pkg, name, time)
|
||||
if bl._hooks[pkg][name] then
|
||||
if not time then
|
||||
bl._hooks[pkg][name] = nil
|
||||
if table.isempty(bl._hooks[pkg]) then
|
||||
if table.empty(bl._hooks[pkg]) then
|
||||
bl._hooks[pkg] = nil
|
||||
deactivatePackage(pkg)
|
||||
end
|
||||
@@ -663,7 +663,7 @@ function bl.unhook(pkg, name, time)
|
||||
error('bl.unhook: argument #3: time must be nil or one of '..
|
||||
'\'before\' \'after\' \'override\'', 2) end
|
||||
bl._hooks[pkg][name][time] = nil
|
||||
if table.isempty(bl._hooks[pkg][name]) and table.empty(bl._hooks[pkg]) then
|
||||
if table.empty(bl._hooks[pkg][name]) and table.empty(bl._hooks[pkg]) then
|
||||
bl._hooks[pkg] = nil
|
||||
deactivatePackage(pkg)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user