|
Roberto Ierusalimschy wrote:
Can't you use the relevant functions as macros? I guess some of these changes can be done through luaconf.h, with code like this: #if defined(LUA_LIB) #define fputs(s,f) myownfputs(s,f) #define fopen(f,o) luaL_error(L, "file operations not available") ... #endif
I could... if they weren't already defined (and broken) in my system. I guess I'd get into linker trouble. Besides, some parts of stdio are working (e.g. sprintf); it's those actually related to the filesystem that aren't: there is a proprietary, incompatible filesystem.
I acknowledge that my case is probably not very common, so usually your solution should work fine. Nethertheless, being able to compile Lua sources on any systems having stdio but not a filesystem could be useful. Many small embedded system libraries offer a reduced stdio that makes the #define trick... well, tricky :-)
Enrico