Permalink
Browse files

also build with msvc

  • Loading branch information...
1 parent fa8b300 commit 44105a941b1b973fe4554024e34e09b8aeab64b1 @syntheticpp syntheticpp committed Jul 27, 2012
Showing with 10 additions and 5 deletions.
  1. +3 −3 src/hash_map.h
  2. +2 −1 src/minidump-win32.cc
  3. +5 −1 src/ninja.cc
View
@@ -55,16 +55,16 @@ using stdext::hash_compare;
struct StringPieceCmp : public hash_compare<StringPiece> {
size_t operator()(const StringPiece& key) const {
- return MurmurHash2(key.str_, key.len_);
+ return MurmurHash2(key.str(), key.len());
}
bool operator()(const StringPiece& a, const StringPiece& b) const {
- int cmp = strncmp(a.str_, b.str_, min(a.len_, b.len_));
+ int cmp = strncmp(a.str(), b.str(), min(a.len(), b.len()));
if (cmp < 0) {
return true;
} else if (cmp > 0) {
return false;
} else {
- return a.len_ < b.len_;
+ return a.len() < b.len();
}
}
};
View
@@ -14,8 +14,9 @@
#ifndef NINJA_BOOTSTRAP
-#include <DbgHelp.h>
#include <windows.h>
+#include <DbgHelp.h>
+
#include "util.h"
View
@@ -628,9 +628,13 @@ int RunBuild(Globals* globals, int argc, char** argv) {
#ifdef _MSC_VER
+} // anonymous namespace
+
// Defined in minidump-win32.cc.
void CreateWin32MiniDump(_EXCEPTION_POINTERS* pep);
+namespace {
+
/// This handler processes fatal crashes that you can't catch
/// Test example: C++ exception in a stack-unwind-block
/// Real-world example: ninja launched a compiler to process a tricky
@@ -820,7 +824,7 @@ int main(int argc, char** argv) {
#if !defined(NINJA_BOOTSTRAP) && defined(_MSC_VER)
// Set a handler to catch crashes not caught by the __try..__except
// block (e.g. an exception in a stack-unwind-block).
- set_terminate(ninja_terminate_fct);
+ set_terminate(TerminateHandler);
__try {
// Running inside __try ... __except suppresses any Windows error
// dialogs for errors such as bad_alloc.

0 comments on commit 44105a9

Please sign in to comment.