Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(39)

Unified Diff: src/processor/logging.cc

Issue 250001: Allow building parts of processor code on Win32 (Closed)
Patch Set: Created 14 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted