diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 10:24:43 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 10:24:43 -0300 |
commit | 557f0009c42ddc8466af83460a2be0eb2d932249 (patch) | |
tree | b0f88e552190451dc6e9111b2e7c5b1806243feb /luaconf.h | |
parent | 0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa (diff) | |
download | lua-557f0009c42ddc8466af83460a2be0eb2d932249.tar.gz lua-557f0009c42ddc8466af83460a2be0eb2d932249.tar.bz2 lua-557f0009c42ddc8466af83460a2be0eb2d932249.zip |
clear definition for `lua_number2int'
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.3 2004/05/10 17:50:51 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.4 2004/05/28 18:32:51 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 | */ |
@@ -156,9 +156,13 @@ | |||
156 | 156 | ||
157 | /* function to convert a lua_Number to int (with any rounding method) */ | 157 | /* function to convert a lua_Number to int (with any rounding method) */ |
158 | #if defined(__GNUC__) && defined(__i386) | 158 | #if defined(__GNUC__) && defined(__i386) |
159 | #define lua_number2int(i,d) __asm__("fldl %1\nfistpl %0":"=m"(i):"m"(d)) | 159 | #define lua_number2int(i,d) __asm__ ("fistpl %0":"=m"(i):"t"(d):"st") |
160 | #elif 0 | ||
161 | /* on machines compliant with C99, you can try `lrint' */ | ||
162 | #include <math.h> | ||
163 | #define lua_number2int(i,d) ((i)=lrint(d)) | ||
160 | #else | 164 | #else |
161 | #define lua_number2int(i,n) ((i)=(int)(n)) | 165 | #define lua_number2int(i,d) ((i)=(int)(d)) |
162 | #endif | 166 | #endif |
163 | 167 | ||
164 | /* function to convert a lua_Number to lua_Integer (with any rounding method) */ | 168 | /* function to convert a lua_Number to lua_Integer (with any rounding method) */ |