lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 13/02/2023 14:17, Roberto Ierusalimschy wrote:
I guess Lua is designed for only those two /hosted/ C implementations in
mind (Win32/64 and *NIX) and has some issues with other platforms C
/hosted/ implementations (which is also understandable, since they are much
rarer nowadays).

That is not true.

Lua is designed with ISO C in mind as its host. Any bit specific for
Windows/Unix should be explicitly turned on by some macro. It should
compile and run in *any* hosted implementation of C that satisfies
either the C 89 standard or the C 99 standard. (C 99 out of the box,
C 89 with the macro LUA_USE_C89 defined.)


Sorry Roberto if I didn't make myself clear. I do know Lua tries to adhere to C standard(s) as much as possible.

I was referring to the OP who mentioned the specific compilation switches for Win/NIX systems, which are hosted environments, whereas bil til was speaking of a freestanding environment, which is not comparable to the OP's situation.

Of course I assume OP's is using a C89 or C99 compliant compiler for a DOS hosted environment.


Lua also has freestanding implementations in mind, but it may need a few
adjustments depending on what is missing. (Case in point: the Lua core
uses 'sprintf'. This function does no I/O and is completely independent
of the OS, but it is not part of the freestanding standard; so, one may
need to provide an implementation for it.)

-- Roberto


-- Lorenzo