commit e24ce8c2b322226bbc211e57f301c265a2622c4b
parent a08d82eb132bfd9db5b91e0d5ebcb81d7b26dcd0
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 21 Jun 2024 12:28:41 -0300
lua_writestring & co. moved to llimits.h
They don't need to be visible by clients of Lua.
Diffstat:
4 files changed, 25 insertions(+), 32 deletions(-)
diff --git a/lauxlib.c b/lauxlib.c
@@ -28,12 +28,6 @@
#include "llimits.h"
-#if !defined(MAX_SIZET)
-/* maximum value for size_t */
-#define MAX_SIZET ((size_t)(~(size_t)0))
-#endif
-
-
/*
** {======================================================
** Traceback
diff --git a/lauxlib.h b/lauxlib.h
@@ -236,30 +236,6 @@ typedef struct luaL_Stream {
/* }====================================================== */
-/*
-** {==================================================================
-** "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
-
-/* }================================================================== */
-
/*
** {============================================================
diff --git a/llimits.h b/llimits.h
@@ -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
+
diff --git a/lstrlib.c b/lstrlib.c
@@ -41,8 +41,6 @@
** Some sizes are better limited to fit in 'int', but must also fit in
** 'size_t'. (We assume that 'lua_Integer' cannot be smaller than 'int'.)
*/
-#define MAX_SIZET ((size_t)(~(size_t)0))
-
#define MAXSIZE \
(sizeof(size_t) < sizeof(int) ? MAX_SIZET : (size_t)(INT_MAX))