diff options
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 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 | */ |
@@ -60,6 +60,18 @@ | |||
60 | 60 | ||
61 | 61 | ||
62 | /* | 62 | /* |
63 | @@ LUA_PATH and LUA_CPATH are the names of the environment variables that | ||
64 | @* Lua check to set its paths. | ||
65 | @@ LUA_INIT is the name of the environment variable that Lua | ||
66 | @* checks for initialization code. | ||
67 | ** CHANGE them if you want different names. | ||
68 | */ | ||
69 | #define LUA_PATH "LUA_PATH" | ||
70 | #define LUA_CPATH "LUA_CPATH" | ||
71 | #define LUA_INIT "LUA_INIT" | ||
72 | |||
73 | |||
74 | /* | ||
63 | @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for | 75 | @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for |
64 | @* Lua libraries. | 76 | @* Lua libraries. |
65 | @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for | 77 | @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for |
@@ -543,11 +555,25 @@ | |||
543 | /* On a Pentium, resort to a trick */ | 555 | /* On a Pentium, resort to a trick */ |
544 | #if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ | 556 | #if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ |
545 | (defined(__i386) || defined (_M_IX86) || defined(__i386__)) | 557 | (defined(__i386) || defined (_M_IX86) || defined(__i386__)) |
558 | |||
559 | /* On a Microsoft compiler, use assembler */ | ||
560 | #if defined(_MSC_VER) | ||
561 | |||
562 | #define lua_number2int(i,d) __asm fld d __asm fistp i | ||
563 | #define lua_number2integer(i,n) lua_number2int(i, n) | ||
564 | |||
565 | /* the next trick should work on any Pentium, but sometimes clashes | ||
566 | with a DirectX idiosyncrasy */ | ||
567 | #else | ||
568 | |||
546 | union luai_Cast { double l_d; long l_l; }; | 569 | union luai_Cast { double l_d; long l_l; }; |
547 | #define lua_number2int(i,d) \ | 570 | #define lua_number2int(i,d) \ |
548 | { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; } | 571 | { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; } |
549 | #define lua_number2integer(i,n) lua_number2int(i, n) | 572 | #define lua_number2integer(i,n) lua_number2int(i, n) |
550 | 573 | ||
574 | #endif | ||
575 | |||
576 | |||
551 | /* this option always works, but may be slow */ | 577 | /* this option always works, but may be slow */ |
552 | #else | 578 | #else |
553 | #define lua_number2int(i,d) ((i)=(int)(d)) | 579 | #define lua_number2int(i,d) ((i)=(int)(d)) |