diff options
-rw-r--r-- | loslib.c | 9 | ||||
-rw-r--r-- | luaconf.h | 4 |
2 files changed, 7 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.15 2005/12/15 18:17:49 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.16 2005/12/22 16:19:56 roberto Exp roberto $ |
3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | 22 | ||
23 | static int os_pushresult (lua_State *L, int i, const char *filename) { | 23 | static int os_pushresult (lua_State *L, int i, const char *filename) { |
24 | int en = errno; /* calls to Lua API may change this value */ | ||
24 | if (i) { | 25 | if (i) { |
25 | lua_pushboolean(L, 1); | 26 | lua_pushboolean(L, 1); |
26 | return 1; | 27 | return 1; |
@@ -28,10 +29,10 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { | |||
28 | else { | 29 | else { |
29 | lua_pushnil(L); | 30 | lua_pushnil(L); |
30 | if (filename) | 31 | if (filename) |
31 | lua_pushfstring(L, "%s: %s", filename, strerror(errno)); | 32 | lua_pushfstring(L, "%s: %s", filename, strerror(en)); |
32 | else | 33 | else |
33 | lua_pushfstring(L, "%s", strerror(errno)); | 34 | lua_pushfstring(L, "%s", strerror(en)); |
34 | lua_pushinteger(L, errno); | 35 | lua_pushinteger(L, en); |
35 | return 3; | 36 | return 3; |
36 | } | 37 | } |
37 | } | 38 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.78 2006/01/13 19:36:28 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.79 2006/01/23 19:51:43 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 | */ |
@@ -541,7 +541,7 @@ | |||
541 | */ | 541 | */ |
542 | 542 | ||
543 | /* On a Pentium, resort to a trick */ | 543 | /* On a Pentium, resort to a trick */ |
544 | #if !defined(LUA_ANSI) && !defined(__SSE2__) && \ | 544 | #if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ |
545 | (defined(__i386) || defined (_M_IX86) || defined(__i386__)) | 545 | (defined(__i386) || defined (_M_IX86) || defined(__i386__)) |
546 | union luai_Cast { double l_d; long l_l; }; | 546 | union luai_Cast { double l_d; long l_l; }; |
547 | #define lua_number2int(i,d) \ | 547 | #define lua_number2int(i,d) \ |