commit 81736885429eb660aa39a210ef1ecddf347e001d
parent 3ef5a6797f5aa7c7cb6b970d92b3c6d52d8e9aaf
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 27 Jan 2006 11:54:16 -0200
detail
Diffstat:
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/loslib.c b/loslib.c
@@ -1,5 +1,5 @@
/*
-** $Id: loslib.c,v 1.15 2005/12/15 18:17:49 roberto Exp roberto $
+** $Id: loslib.c,v 1.16 2005/12/22 16:19:56 roberto Exp roberto $
** Standard Operating System library
** See Copyright Notice in lua.h
*/
@@ -21,6 +21,7 @@
static int os_pushresult (lua_State *L, int i, const char *filename) {
+ int en = errno; /* calls to Lua API may change this value */
if (i) {
lua_pushboolean(L, 1);
return 1;
@@ -28,10 +29,10 @@ static int os_pushresult (lua_State *L, int i, const char *filename) {
else {
lua_pushnil(L);
if (filename)
- lua_pushfstring(L, "%s: %s", filename, strerror(errno));
+ lua_pushfstring(L, "%s: %s", filename, strerror(en));
else
- lua_pushfstring(L, "%s", strerror(errno));
- lua_pushinteger(L, errno);
+ lua_pushfstring(L, "%s", strerror(en));
+ lua_pushinteger(L, en);
return 3;
}
}
diff --git a/luaconf.h b/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.78 2006/01/13 19:36:28 roberto Exp roberto $
+** $Id: luaconf.h,v 1.79 2006/01/23 19:51:43 roberto Exp roberto $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -541,7 +541,7 @@
*/
/* On a Pentium, resort to a trick */
-#if !defined(LUA_ANSI) && !defined(__SSE2__) && \
+#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
union luai_Cast { double l_d; long l_l; };
#define lua_number2int(i,d) \