Bug 1377948 Silence two warnings that occur as errors on the MinGW build r=arai

MozReview-Commit-ID: LQBAoLVpVab

--HG--
extra : rebase_source : cbda28f37cf0c6ce7f187af5b65b8d06d238118c
This commit is contained in:
Tom Ritter 2017-07-03 15:53:42 -05:00
Родитель f6ee4abf9c
Коммит 243eb2684d
2 изменённых файлов: 13 добавлений и 3 удалений

0
js/src/moz.build Normal file → Executable file
Просмотреть файл

16
js/src/vm/Time.cpp Normal file → Executable file
Просмотреть файл

@ -269,8 +269,10 @@ PRMJ_FormatTime(char* buf, int buflen, const char* fmt, PRMJTime* prtm)
int fake_tm_year = 0; int fake_tm_year = 0;
#ifdef XP_WIN #ifdef XP_WIN
_invalid_parameter_handler oldHandler; _invalid_parameter_handler oldHandler;
#ifndef __MINGW32__
int oldReportMode; int oldReportMode;
#endif #endif // __MINGW32__
#endif //XP_WIN
memset(&a, 0, sizeof(struct tm)); memset(&a, 0, sizeof(struct tm));
@ -343,15 +345,23 @@ PRMJ_FormatTime(char* buf, int buflen, const char* fmt, PRMJTime* prtm)
#ifdef XP_WIN #ifdef XP_WIN
oldHandler = _set_invalid_parameter_handler(PRMJ_InvalidParameterHandler); oldHandler = _set_invalid_parameter_handler(PRMJ_InvalidParameterHandler);
#ifndef __MINGW32__
/*
* MinGW doesn't have _CrtSetReportMode and defines it to be a no-op.
* We ifdef it off to avoid warnings about unused variables
*/
oldReportMode = _CrtSetReportMode(_CRT_ASSERT, 0); oldReportMode = _CrtSetReportMode(_CRT_ASSERT, 0);
#endif #endif // __MINGW32__
#endif // XP_WIN
result = strftime(buf, buflen, fmt, &a); result = strftime(buf, buflen, fmt, &a);
#ifdef XP_WIN #ifdef XP_WIN
_set_invalid_parameter_handler(oldHandler); _set_invalid_parameter_handler(oldHandler);
#ifndef __MINGW32__
_CrtSetReportMode(_CRT_ASSERT, oldReportMode); _CrtSetReportMode(_CRT_ASSERT, oldReportMode);
#endif #endif // __MINGW32__
#endif // XP_WIN
if (fake_tm_year && result) { if (fake_tm_year && result) {
char real_year[16]; char real_year[16];