aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lobject.c22
-rw-r--r--luaconf.h45
2 files changed, 26 insertions, 41 deletions
diff --git a/lobject.c b/lobject.c
index b329be69..e805ce66 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.94 2014/10/24 11:42:29 roberto Exp roberto $ 2** $Id: lobject.c,v 2.95 2014/10/25 11:50:46 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -162,24 +162,8 @@ static int isneg (const char **s) {
162} 162}
163 163
164 164
165/*
166** {======================================================
167** lua_strx2number converts an hexadecimal numeric string to a number.
168** In C99, 'strtod' does both conversions. C89, however, has no function
169** to convert floating hexadecimal strings to numbers. For these
170** systems, you can leave 'lua_strx2number' undefined and Lua will
171** provide its own implementation.
172** =======================================================
173*/
174#if !defined(lua_strx2number) /* { */
175
176#if defined(LUA_USE_C99) /* { */
177
178#define lua_strx2number(s,p) lua_str2number(s,p)
179
180#else /* }{ */
181
182/* Lua's implementation for 'lua_strx2number' */ 165/* Lua's implementation for 'lua_strx2number' */
166#if !defined(lua_strx2number) /* { */
183 167
184#include <math.h> 168#include <math.h>
185 169
@@ -247,8 +231,6 @@ static lua_Number lua_strx2number (const char *s, char **endptr) {
247 231
248#endif /* } */ 232#endif /* } */
249 233
250#endif /* } */
251
252/* }====================================================== */ 234/* }====================================================== */
253 235
254 236
diff --git a/luaconf.h b/luaconf.h
index 620e9d42..12ae62e5 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.222 2014/10/27 16:59:31 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.223 2014/10/27 18:06:03 roberto Exp roberto $
3** Configuration file for Lua 3** Configuration file for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -95,24 +95,6 @@
95#endif 95#endif
96 96
97 97
98/*
99@@ LUA_USE_C99 includes all functionality that depends on C 99.
100** CHANGE it (define it) if your system is compatible.
101*/
102#if defined(LUA_USE_C99)
103#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
104#endif
105
106
107/*
108@@ LUA_USE_POSIX includes all functionality listed as X/Open System
109@@ Interfaces Extension (XSI).
110** CHANGE it (define it) if your system is XSI compatible.
111*/
112#if defined(LUA_USE_POSIX)
113#endif
114
115
116 98
117#include <limits.h> 99#include <limits.h>
118#include <stddef.h> 100#include <stddef.h>
@@ -287,8 +269,8 @@
287 269
288/* 270/*
289@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation 271@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
290@@ functions. It must be a numerical type; Lua will use 'intptr_t' if 272** functions. It must be a numerical type; Lua will use 'intptr_t' if
291@@ available. 273** available.
292*/ 274*/
293#if defined (LUA_USE_C99) 275#if defined (LUA_USE_C99)
294#include <stdint.h> 276#include <stdint.h>
@@ -304,6 +286,27 @@
304 286
305 287
306/* 288/*
289@@ lua_strx2number converts an hexadecimal numeric string to a number.
290** In C99, 'strtod' does both conversions. Otherwise, you can
291** leave 'lua_strx2number' undefined and Lua will provide its own
292** implementation.
293*/
294#if defined(LUA_USE_C99)
295#define lua_strx2number(s,p) lua_str2number(s,p)
296#endif
297
298
299/*
300@@ LUA_USE_AFORMAT allows '%a'/'%A' specifiers in 'string.format'
301** Enable it if the C function 'printf' supports these specifiers.
302** (C99 demands it.)
303*/
304#if !defined(LUA_USE_AFORMAT) && defined(LUA_USE_C99)
305#define LUA_USE_AFORMAT
306#endif
307
308
309/*
307** {================================================================== 310** {==================================================================
308** Compatibility with previous versions 311** Compatibility with previous versions
309** =================================================================== 312** ===================================================================