commit 4870194380c4fcf40ffa20ef06956a462b3fd10c
parent 41d0e661846275994262f7e94c879d02254ef0ef
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 27 Oct 2014 17:21:31 -0200
small reorganization of tests around LUA_USE_C99
Diffstat:
M | lobject.c | | | 22 | ++-------------------- |
M | luaconf.h | | | 45 | ++++++++++++++++++++++++--------------------- |
2 files changed, 26 insertions(+), 41 deletions(-)
diff --git a/lobject.c b/lobject.c
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.c,v 2.94 2014/10/24 11:42:29 roberto Exp roberto $
+** $Id: lobject.c,v 2.95 2014/10/25 11:50:46 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ -162,24 +162,8 @@ static int isneg (const char **s) {
}
-/*
-** {======================================================
-** lua_strx2number converts an hexadecimal numeric string to a number.
-** In C99, 'strtod' does both conversions. C89, however, has no function
-** to convert floating hexadecimal strings to numbers. For these
-** systems, you can leave 'lua_strx2number' undefined and Lua will
-** provide its own implementation.
-** =======================================================
-*/
-#if !defined(lua_strx2number) /* { */
-
-#if defined(LUA_USE_C99) /* { */
-
-#define lua_strx2number(s,p) lua_str2number(s,p)
-
-#else /* }{ */
-
/* Lua's implementation for 'lua_strx2number' */
+#if !defined(lua_strx2number) /* { */
#include <math.h>
@@ -247,8 +231,6 @@ static lua_Number lua_strx2number (const char *s, char **endptr) {
#endif /* } */
-#endif /* } */
-
/* }====================================================== */
diff --git a/luaconf.h b/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.222 2014/10/27 16:59:31 roberto Exp roberto $
+** $Id: luaconf.h,v 1.223 2014/10/27 18:06:03 roberto Exp roberto $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -95,24 +95,6 @@
#endif
-/*
-@@ LUA_USE_C99 includes all functionality that depends on C 99.
-** CHANGE it (define it) if your system is compatible.
-*/
-#if defined(LUA_USE_C99)
-#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
-#endif
-
-
-/*
-@@ LUA_USE_POSIX includes all functionality listed as X/Open System
-@@ Interfaces Extension (XSI).
-** CHANGE it (define it) if your system is XSI compatible.
-*/
-#if defined(LUA_USE_POSIX)
-#endif
-
-
#include <limits.h>
#include <stddef.h>
@@ -287,8 +269,8 @@
/*
@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
-@@ functions. It must be a numerical type; Lua will use 'intptr_t' if
-@@ available.
+** functions. It must be a numerical type; Lua will use 'intptr_t' if
+** available.
*/
#if defined (LUA_USE_C99)
#include <stdint.h>
@@ -304,6 +286,27 @@
/*
+@@ lua_strx2number converts an hexadecimal numeric string to a number.
+** In C99, 'strtod' does both conversions. Otherwise, you can
+** leave 'lua_strx2number' undefined and Lua will provide its own
+** implementation.
+*/
+#if defined(LUA_USE_C99)
+#define lua_strx2number(s,p) lua_str2number(s,p)
+#endif
+
+
+/*
+@@ LUA_USE_AFORMAT allows '%a'/'%A' specifiers in 'string.format'
+** Enable it if the C function 'printf' supports these specifiers.
+** (C99 demands it.)
+*/
+#if !defined(LUA_USE_AFORMAT) && defined(LUA_USE_C99)
+#define LUA_USE_AFORMAT
+#endif
+
+
+/*
** {==================================================================
** Compatibility with previous versions
** ===================================================================