Fix compilation with old g++ 3.3.5 and debian-sarge.
[wvstreams.git] / utils / wvassert.cc
blob3a3d8e87a337856d9f6e2a4ccbdd73940ffbf9d5
1 /*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2005 Net Integration Technologies, Inc.
5 * Helper classes and functions to add more information to WvCrashes.
6 */
8 #include "wvassert.h"
10 WvCrashWill::WvCrashWill(const char *will)
11 : old_will(wvcrash_read_will())
13 wvcrash_leave_will(will);
16 WvCrashWill::WvCrashWill(WVSTRING_FORMAT_DEFN)
17 : old_will(wvcrash_read_will())
19 // We use a WvFastString here, because it is a temporary. init()
20 // will duplicate the string into a local buffer, so don't you
21 // worry.
22 wvcrash_leave_will(WvFastString(WVSTRING_FORMAT_CALL));
25 void WvCrashWill::rewrite(const char *will)
27 // Don't touch old_will.
28 wvcrash_leave_will(will);
31 void WvCrashWill::rewrite(WVSTRING_FORMAT_DEFN)
33 // Again, since wvcrash_leave_will will duplicate the string, we
34 // can use a WvFastString.
35 rewrite(WvFastString(WVSTRING_FORMAT_CALL));
38 WvCrashWill::~WvCrashWill()
40 // Put the old will back.
41 wvcrash_leave_will(old_will);