From 9ecc007b5b7a4e367d1f2183d62f4d31ee131ff9 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Wed, 14 Jan 2009 13:00:07 -0500 Subject: [PATCH] move sayDbContext to stdafx (it was defined there anyway) --- db/pdfile.cpp | 10 ---------- db/pdfile.h | 2 -- stdafx.cpp | 12 +++++++++++- stdafx.h | 3 ++- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/db/pdfile.cpp b/db/pdfile.cpp index 8028a7cea75..c9a3d8f4929 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -62,16 +62,6 @@ string getDbContext() { return ss.str(); } -/* this is a good place to set a breakpoint when debugging, as lots of warning things - (assert, wassert) call it. -*/ -void sayDbContext(const char *errmsg) { - if ( errmsg ) { - problem() << errmsg << endl; - } - printStackTrace(); -} - BSONObj::BSONObj(Record *r) { init(r->data, false); /* diff --git a/db/pdfile.h b/db/pdfile.h index c92617178cf..d4183d15a7a 100644 --- a/db/pdfile.h +++ b/db/pdfile.h @@ -288,8 +288,6 @@ inline Record* PhysicalDataFile::recordAt(DiskLoc dl) { return header->getRecord(dl); } -void sayDbContext(const char *msg = 0); - inline DiskLoc Record::getNext(const DiskLoc& myLoc) { if ( nextOfs != DiskLoc::NullOfs ) { /* defensive */ diff --git a/stdafx.cpp b/stdafx.cpp index a5572b442be..b881d8a9a17 100644 --- a/stdafx.cpp +++ b/stdafx.cpp @@ -32,7 +32,6 @@ Assertion lastAssert[4]; #include "db/lasterror.h" string getDbContext(); -void sayDbContext(const char *errmsg = 0); /* "warning" assert -- safe to continue, so we don't throw exception. */ void wasserted(const char *msg, const char *file, unsigned line) { @@ -80,3 +79,14 @@ string Assertion::toString() { ss << file << ' ' << line << '\n'; return ss.str(); } + +/* this is a good place to set a breakpoint when debugging, as lots of warning things + (assert, wassert) call it. +*/ +void sayDbContext(const char *errmsg) { + if ( errmsg ) { + problem() << errmsg << endl; + } + printStackTrace(); +} + diff --git a/stdafx.h b/stdafx.h index 7edaa283a7b..6b24f8223d9 100644 --- a/stdafx.h +++ b/stdafx.h @@ -34,7 +34,8 @@ const bool debug=false; #include "string.h" #include "limits.h" -extern void dbexit(int returnCode, const char *whyMsg = ""); +void sayDbContext(const char *msg = 0); +void dbexit(int returnCode, const char *whyMsg = ""); inline void * ourmalloc(size_t size) { void *x = malloc(size);