Bug 1111244 - Remove some code specific to old unsupported MSVC versions from js/src; r=Waldo

This commit is contained in:
Ehsan Akhgari 2015-01-02 17:32:43 -05:00
parent 7a1b927b37
commit a111a190ad
3 changed files with 6 additions and 14 deletions

View File

@ -104,7 +104,7 @@
***********************************************************************/
#define JS_BEGIN_MACRO do {
#if defined(_MSC_VER) && _MSC_VER >= 1400
#if defined(_MSC_VER)
# define JS_END_MACRO \
} __pragma(warning(push)) __pragma(warning(disable:4127)) \
while (0) __pragma(warning(pop))

View File

@ -23,17 +23,9 @@
#ifdef XP_WIN
#include <windef.h>
#include <winbase.h>
/* VC++ 8.0 or later */
#if _MSC_VER >= 1400
#define NS_HAVE_INVALID_PARAMETER_HANDLER 1
#endif
#ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
#include <crtdbg.h> /* for _CrtSetReportMode */
#endif
#include <mmsystem.h> /* for timeBegin/EndPeriod */
#ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
#include <stdlib.h> /* for _set_invalid_parameter_handler */
#endif
#include "prinit.h"
@ -255,7 +247,7 @@ PRMJ_Now()
}
#endif
#ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
#ifdef XP_WIN
static void
PRMJ_InvalidParameterHandler(const wchar_t *expression,
const wchar_t *function,
@ -275,7 +267,7 @@ PRMJ_FormatTime(char *buf, int buflen, const char *fmt, PRMJTime *prtm)
#if defined(XP_UNIX) || defined(XP_WIN)
struct tm a;
int fake_tm_year = 0;
#ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
#ifdef XP_WIN
_invalid_parameter_handler oldHandler;
int oldReportMode;
#endif
@ -349,14 +341,14 @@ PRMJ_FormatTime(char *buf, int buflen, const char *fmt, PRMJTime *prtm)
* changeover time.)
*/
#ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
#ifdef XP_WIN
oldHandler = _set_invalid_parameter_handler(PRMJ_InvalidParameterHandler);
oldReportMode = _CrtSetReportMode(_CRT_ASSERT, 0);
#endif
result = strftime(buf, buflen, fmt, &a);
#ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
#ifdef XP_WIN
_set_invalid_parameter_handler(oldHandler);
_CrtSetReportMode(_CRT_ASSERT, oldReportMode);
#endif

View File

@ -268,7 +268,7 @@ js::NativeObject::slotInRange(uint32_t slot, SentinelAllowed sentinel) const
}
#endif /* DEBUG */
#if defined(_MSC_VER) && _MSC_VER >= 1500
#if defined(_MSC_VER)
/*
* Work around a compiler bug in MSVC9 and above, where inlining this function
* causes stack pointer offsets to go awry and spp to refer to something higher