Index: src/processor/logging.cc |
=================================================================== |
--- a/src/processor/logging.cc |
+++ b/src/processor/logging.cc |
@@ -39,23 +39,31 @@ |
#include <string.h> |
#include <time.h> |
#include "processor/logging.h" |
#include "processor/pathname_stripper.h" |
namespace google_breakpad { |
+#ifdef _WIN32 |
Mark Mentovai
2011/01/11 19:44:54
Outside of the namespace, please.
|
+#define snprintf _snprintf |
+#endif |
+ |
LogStream::LogStream(std::ostream &stream, Severity severity, |
const char *file, int line) |
: stream_(stream) { |
time_t clock; |
time(&clock); |
struct tm tm_struct; |
+#ifdef _WIN32 |
+ localtime_s(&tm_struct, &clock); |
+#else |
localtime_r(&clock, &tm_struct); |
+#endif |
char time_string[20]; |
strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct); |
const char *severity_string = "UNKNOWN_SEVERITY"; |
switch (severity) { |
case SEVERITY_INFO: |
severity_string = "INFO"; |
break; |