diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index 74f8eb57dcc..5975fcd83bc 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -41,9 +41,6 @@ /* * JS number type and wrapper class. */ -#if defined(XP_WIN) || defined(XP_OS2) -#include -#endif #ifdef XP_OS2 #define _PC_53 PC_53 #define _MCW_EM MCW_EM diff --git a/js/src/jsnum.h b/js/src/jsnum.h index a4b8422b231..e521170e3ec 100644 --- a/js/src/jsnum.h +++ b/js/src/jsnum.h @@ -40,8 +40,10 @@ #ifndef jsnum_h___ #define jsnum_h___ -#include #include +#if defined(XP_WIN) || defined(XP_OS2) +#include +#endif /* * JS number (IEEE double) interface. @@ -97,6 +99,17 @@ JSDOUBLE_IS_FINITE(jsdouble d) #endif } +static inline int +JSDOUBLE_IS_INFINITE(jsdouble d) +{ +#ifdef WIN32 + int c = _fpclass(d); + return c == _FPCLASS_NINF || c == _FPCLASS_PINF; +#else + return isinf(d); +#endif +} + static inline int JSDOUBLE_IS_NEGZERO(jsdouble d) {