Bug 1377948 Silence two warnings that occur as errors on the MinGW build
MozReview-Commit-ID: LQBAoLVpVab
old mode 100644
new mode 100755
old mode 100644
new mode 100755
--- a/js/src/vm/Time.cpp
+++ b/js/src/vm/Time.cpp
@@ -264,18 +264,20 @@ size_t
PRMJ_FormatTime(char* buf, int buflen, const char* fmt, PRMJTime* prtm)
{
size_t result = 0;
#if defined(XP_UNIX) || defined(XP_WIN)
struct tm a;
int fake_tm_year = 0;
#ifdef XP_WIN
_invalid_parameter_handler oldHandler;
+#ifndef __MINGW32__
int oldReportMode;
-#endif
+#endif // __MINGW32__
+#endif //XP_WIN
memset(&a, 0, sizeof(struct tm));
a.tm_sec = prtm->tm_sec;
a.tm_min = prtm->tm_min;
a.tm_hour = prtm->tm_hour;
a.tm_mday = prtm->tm_mday;
a.tm_mon = prtm->tm_mon;
@@ -338,25 +340,33 @@ PRMJ_FormatTime(char* buf, int buflen, c
* Even with the above, SunOS 4 seems to detonate if tm_zone and tm_gmtoff
* are null. This doesn't quite work, though - the timezone is off by
* tzoff + dst. (And mktime seems to return -1 for the exact dst
* changeover time.)
*/
#ifdef XP_WIN
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);
-#endif
+#endif // __MINGW32__
+#endif // XP_WIN
result = strftime(buf, buflen, fmt, &a);
#ifdef XP_WIN
_set_invalid_parameter_handler(oldHandler);
+#ifndef __MINGW32__
_CrtSetReportMode(_CRT_ASSERT, oldReportMode);
-#endif
+#endif // __MINGW32__
+#endif // XP_WIN
if (fake_tm_year && result) {
char real_year[16];
char fake_year[16];
size_t real_year_len;
size_t fake_year_len;
char* p;