diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-04-06 14:30:13 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-04-06 14:30:13 -0300 |
| commit | de0bfe33b7380fcf165b95dd36895865e1321226 (patch) | |
| tree | 2a3bd2d7cf81517f00ae34c9bcf9005eb3a6079e | |
| parent | 9768e2f6819842ff39bced5ba979e787024caac9 (diff) | |
| download | lua-de0bfe33b7380fcf165b95dd36895865e1321226.tar.gz lua-de0bfe33b7380fcf165b95dd36895865e1321226.tar.bz2 lua-de0bfe33b7380fcf165b95dd36895865e1321226.zip | |
new definition for `lua_number2int' for Windows (not tested yet!)
| -rw-r--r-- | luaconf.h | 16 |
1 files changed, 5 insertions, 11 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: luaconf.h,v 1.39 2005/03/29 14:30:16 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.40 2005/03/29 16:20:48 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 | */ |
| @@ -407,16 +407,10 @@ | |||
| 407 | 407 | ||
| 408 | /* On Windows/Pentium, resort to assembler */ | 408 | /* On Windows/Pentium, resort to assembler */ |
| 409 | #elif !defined(__STRICT_ANSI__) && defined(_MSC_VER) && defined(_M_IX86) | 409 | #elif !defined(__STRICT_ANSI__) && defined(_MSC_VER) && defined(_M_IX86) |
| 410 | #pragma warning(disable: 4514) | 410 | #define lua_number2int(i,d) __asm { \ |
| 411 | __inline int l_lrint (double flt) | 411 | fld d \ |
| 412 | { int i; | 412 | fistp i \ |
| 413 | _asm { | 413 | } |
| 414 | fld flt | ||
| 415 | fistp i | ||
| 416 | }; | ||
| 417 | return i; | ||
| 418 | } | ||
| 419 | #define lua_number2int(i,d) ((i)=l_lrint((d))) | ||
| 420 | 414 | ||
| 421 | /* on Pentium machines compliant with C99, you can try lrint */ | 415 | /* on Pentium machines compliant with C99, you can try lrint */ |
| 422 | #elif defined (__i386) && defined(__STDC_VERSION__) && \ | 416 | #elif defined (__i386) && defined(__STDC_VERSION__) && \ |
