lua_writestring & co. moved to llimits.h

They don't need to be visible by clients of Lua.
This commit is contained in:
Roberto Ierusalimschy
2024-06-21 12:29:08 -03:00
parent a08d82eb13
commit e24ce8c2b3
4 changed files with 25 additions and 32 deletions

View File

@@ -244,4 +244,29 @@ typedef unsigned long l_uint32;
#endif
/*
** {==================================================================
** "Abstraction Layer" for basic report of messages and errors
** ===================================================================
*/
/* print a string */
#if !defined(lua_writestring)
#define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
#endif
/* print a newline and flush the output */
#if !defined(lua_writeline)
#define lua_writeline() (lua_writestring("\n", 1), fflush(stdout))
#endif
/* print an error message */
#if !defined(lua_writestringerror)
#define lua_writestringerror(s,p) \
(fprintf(stderr, (s), (p)), fflush(stderr))
#endif
/* }================================================================== */
#endif