> So do I rename ...\lua5.1\src\lua.c(h) to ...\lua5.1\src\lua51.c(h) as well or is that unecessary? I assume I include ...\lua5.1\src\lua.(h) in ...\lua5.x\src\lua.c?
Easiest would be to have a full set of unmodified source files for 5.1 and 5.x in separate directories, say src51 and src5x, then either lua.c will reference lua.h (and everything else) from its own directory. And then tweak those files as described earlier.
> I will need to try to understand why it needs to be static (I'll look that up).
You could try making the pointers not static and see what happens. I'm pretty sure the difference will then be obvious :)
> Here is another question the could only be asked by someone ignorant to C nuances: As an alternative to the above, could I just rename each main() to mainL() and make them NOT static, compile the lua.c files into the lua5x.dll and then just call the appropriate mainL from a new lua.c that I write?