/* printf("Checked %s:%d\n", file, line); */
}
+/*
+ * Print a suitable leader for an error message.
+ */
+static void
+error_leader(const char *filename, int line)
+{
+#if _MSC_VER
+ return ("%s (%d): ", filename, line);
+#else
+ printf ("%s:%d: ", filename, line);
+#endif
+}
+
/*
* Count this failure; return true if this failure is being reported.
*/
if (failed_lines[line].count++ == 0 || verbose) {
va_list ap;
va_start(ap, fmt);
- fprintf(stderr, "%s:%d: ", filename, line);
+ error_leader(filename, line);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
finish_failure(NULL);
return (0);
}
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
if (mode < 0)
return (1);
if (mode != (st.st_mode & 07777)) {
}
return (0);
}
+#endif
return (1);
}