Piotr Caban <piotr.caban(a)gmail.com> writes:
> diff --git a/dlls/jscript/jscript_main.c b/dlls/jscript/jscript_main.c
> index 37266e5..740bb06 100644
> --- a/dlls/jscript/jscript_main.c
> +++ b/dlls/jscript/jscript_main.c
> @@ -38,6 +38,21 @@ static const CLSID CLSID_JScriptAuthor =
> static const CLSID CLSID_JScriptEncode =
> {0xf414c262,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}};
>
> +#ifndef NAN
> +DOUBLE NAN;
> +
> +static inline void set_jsnan(void)
> +{
> + VARIANT v;
> + V_UI8(&v) = (ULONGLONG)0x7ff80000<<32;
> + NAN = V_R8(&v);
> +}
> +#else
> +static inline void set_jsnan(void)
> +{
> +}
> +#endif
> +
> DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
>
> static HINSTANCE jscript_hinstance;
> @@ -110,6 +125,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
> return FALSE; /* prefer native version */
> case DLL_PROCESS_ATTACH:
> DisableThreadLibraryCalls(hInstDLL);
> + set_jsnan();
> jscript_hinstance = hInstDLL;
> break;
The previous implementation was better, having to explicitly initialize
the constant on startup is ugly.
--
Alexandre Julliard
julliard(a)winehq.org