aboutsummaryrefslogtreecommitdiff
path: root/src/processor/minidump.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/processor/minidump.cc')
-rw-r--r--src/processor/minidump.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index 41e7cea6..3d42c428 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -40,14 +40,15 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
-#include <unistd.h>
+
#ifdef _WIN32
#include <io.h>
typedef SSIZE_T ssize_t;
-#define open _open
-#define read _read
-#define lseek _lseek
+#define PRIx64 "llx"
+#define PRIx32 "lx"
+#define snprintf _snprintf
#else // _WIN32
+#include <unistd.h>
#define O_BINARY 0
#endif // _WIN32
@@ -1101,7 +1102,7 @@ void MinidumpMemoryRegion::SetDescriptor(MDMemoryDescriptor* descriptor) {
descriptor_ = descriptor;
valid_ = descriptor &&
descriptor_->memory.data_size <=
- numeric_limits<uint64_t>::max() -
+ numeric_limits<u_int64_t>::max() -
descriptor_->start_of_memory_range;
}
@@ -3694,7 +3695,11 @@ void Minidump::Print() {
printf(" stream_directory_rva = 0x%x\n", header_.stream_directory_rva);
printf(" checksum = 0x%x\n", header_.checksum);
struct tm timestruct;
+#ifdef _WIN32
+ gmtime_s(&timestruct, reinterpret_cast<time_t*>(&header_.time_date_stamp));
+#else
gmtime_r(reinterpret_cast<time_t*>(&header_.time_date_stamp), &timestruct);
+#endif
char timestr[20];
strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct);
printf(" time_date_stamp = 0x%x %s\n", header_.time_date_stamp,