aboutsummaryrefslogtreecommitdiff
path: root/luaconf.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-04-06 14:30:13 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-04-06 14:30:13 -0300
commitde0bfe33b7380fcf165b95dd36895865e1321226 (patch)
tree2a3bd2d7cf81517f00ae34c9bcf9005eb3a6079e /luaconf.h
parent9768e2f6819842ff39bced5ba979e787024caac9 (diff)
downloadlua-de0bfe33b7380fcf165b95dd36895865e1321226.tar.gz
lua-de0bfe33b7380fcf165b95dd36895865e1321226.tar.bz2
lua-de0bfe33b7380fcf165b95dd36895865e1321226.zip
new definition for `lua_number2int' for Windows (not tested yet!)
Diffstat (limited to 'luaconf.h')
-rw-r--r--luaconf.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/luaconf.h b/luaconf.h
index 9f86f962..83221e8b 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -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__) && \