shim: fix size_t and ptrdiff_t definitions
Prior to a recent change to 9front which made the usize type
64-bit on 64-bit machines there was no nice way to define a
proper size_t, so I opted to hardcode it to uvlong, which
avoided the need for patching a bunch of tricky upstream code
dealing with size limits and whatnot. This, of course, made
it so that Lua would only compile on 64-bit platforms.
With this change Lua now builds for all the usually supported
9front platforms: amd64, 386, arm, arm64.
shim: correct the size of status message buffer
luac: make it compile and run
mem: revert setmalloctag on l_alloc
For unknown reasons this causes the leak analysis to produce
false-positives. Revert until this is understood / fixed.
mem: tag allocations for better profiling information
os9: fix wait(2) message leak
shim: incorporate shim code into liblua
Having shim code in a separate repository seemed like a good
idea since it could have been reused by different projects.
However, this didn't really occur since I realized that it's
best to provide only the shim code that's needed on a per-port
basis -- for which a simple copy-paste approach works fine.
This change simplifies the project structure and makes it easier
for others to use liblua -- all they need is liblua.
However, it is still neccessary to tell the compiler where
the shim headers are. It's not great, but better than dumping
all this stuff into lua's own directory.
core: insert pragma incomplete where neccessary
build: use nicer object archive name
los9lib: fix compiler warnings
los9lib: fix conversion specifier
los9lib: consistently return Lua integers for timestamp values
los9lib: use Epochalypse-resistant tmtime() API
los9lib: make os.date accept and output Lua rather than C strings
Lua wants the format string and formatted output to be Lua rather than C
strings, allowing embedded zero bytes to be formatted.
This means we can't use the fmtprint(2) routines to directly construct
the output, so we split the formatting into pieces and use a lua_Buffer
to construct the result Lua string.
This also fixes the '%%' escape.