lua-users home
lua-l archive

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


Pavel Vozenilek wrote:
Also one suggestion: someone may like to put all Lua
code into a C++ namespace (e.g. to use two different
Lua versions in a single executable). The sources may
support it by having something like:

------something.c----
#include <stdio.h>

LUA_NAMESPACE_BEGIN
...
... code
....
LUA_NAMESPACE_END
----------------------

with these two macros defined as empty by default.
I would agree with this (and have done it before), but the problem is MUCH larger than just this. There are a ton of #defines in lua.h alone that cause massive conflicts when using two differing versions of Lua interpreters in the same application. The only way I found around that was to wrap the Lua functionality needed and never expose lua.h in a public fashion. This was a pain, to say the least, but in my case, it allowed Lua 5 and Lua 4 to be used in the same application.

Josh