commit a716ae1f50764aa8f785b0fd85a7f533e53756e0
parent ea382b0be136a9abc80281d6950afddc4f25edb9
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 9 Nov 2011 12:46:50 -0200
avoids including 'stdio.h' everywhere (because of definitions for
luai_writestring/luai_writeline)
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/luaconf.h b/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.164 2011/10/07 19:53:05 roberto Exp roberto $
+** $Id: luaconf.h,v 1.165 2011/11/05 15:29:05 roberto Exp roberto $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -210,10 +210,14 @@
/*
@@ luai_writestring/luai_writeline define how 'print' prints its results.
+** They are only used in libraries and the stand-alone program. (The #if
+** avoids including 'stdio.h' everywhere.)
*/
+#if defined(LUA_LIB) || defined(lua_c) || defined(luaall_c)
#include <stdio.h>
#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
#define luai_writeline() (luai_writestring("\n", 1), fflush(stdout))
+#endif
/*
@@ luai_writestringerror defines how to print error messages.