aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--liolib.c4
-rw-r--r--lua.h12
2 files changed, 11 insertions, 5 deletions
diff --git a/liolib.c b/liolib.c
index 00b14921..56a0ee5a 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.115 2001/06/08 16:48:32 roberto Exp roberto $ 2** $Id: liolib.c,v 1.116 2001/06/22 13:49:42 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -263,7 +263,7 @@ static int read_until (lua_State *L, FILE *f, const l_char *p, int pl) {
263 263
264static int read_number (lua_State *L, FILE *f) { 264static int read_number (lua_State *L, FILE *f) {
265 double d; 265 double d;
266 if (fscanf(f, l_s("%lf"), &d) == 1) { 266 if (fscanf(f, l_s(LUA_SCAN_NUMBER), &d) == 1) {
267 lua_pushnumber(L, d); 267 lua_pushnumber(L, d);
268 return 1; 268 return 1;
269 } 269 }
diff --git a/lua.h b/lua.h
index d391ccb0..34615dd5 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.97 2001/04/23 16:35:45 roberto Exp roberto $ 2** $Id: lua.h,v 1.98 2001/06/06 18:00:19 roberto Exp roberto $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
5** e-mail: info@lua.org 5** e-mail: info@lua.org
@@ -292,10 +292,16 @@ LUA_API void lua_pushusertag (lua_State *L, void *u, int tag);
292#define l_charint int 292#define l_charint int
293#endif 293#endif
294 294
295/* function to convert a lua_Number to a string */ 295/*
296** formats for Lua numbers
297*/
298#ifndef LUA_SCAN_NUMBER
299#define LUA_SCAN_NUMBER "%lf"
300#endif
296#ifndef LUA_NUMBER_FMT 301#ifndef LUA_NUMBER_FMT
297#define LUA_NUMBER_FMT "%.16g" 302#define LUA_NUMBER_FMT "%.16g"
298#endif 303#endif
304/* function to convert a lua_Number to a string */
299#ifndef lua_number2str 305#ifndef lua_number2str
300#define lua_number2str(s,n) sprintf((s), l_s(LUA_NUMBER_FMT), (n)) 306#define lua_number2str(s,n) sprintf((s), l_s(LUA_NUMBER_FMT), (n))
301#endif 307#endif