lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

David Burgess wrote:
> + #elif (defined (WIN32) || defined (_WIN32))
> + #include <io.h>
> + #define stdin_is_tty()		_isatty(0)
>   #else

I think it is sufficient to test for _WIN32. M$ does it that way,
they should know. ;-)

> + #elif ((defined (WIN32) || defined (_WIN32)) && defined(_M_IX86))
> + #include	<math.h>
> + #pragma warning(disable: 4514)
> + __inline int lrint (double flt)
> + {	int i;
> + 	_asm {
> +       fld flt
> +       fistp i
> + 	};
> + 	return i;
> + }
> + #define lua_number2int(i,d)	((i)=lrint((d)))
>   #else

Testing for _WIN32 is testing for the OS API. But since your code is
specific to the compiler (and CPU) you want to test for _MSC_VER and
_M_IX86.

I'm cross-compiling on a Linux host for a WIN32 PE executable target
and things like this do matter then.

Bye,
     Mike