2 // { dg-additional-options "-Wno-return-type" }
4 extern "C" class WvFastString;
5 typedef WvFastString& WvStringParm;
10 class WvString : WvFastString {};
12 class WvIPAddr : WvAddr {};
13 struct WvIPNet : WvIPAddr {
16 template<class T, bool> struct WvTraits_Helper {
17 static void release(T *obj) {
21 template<class From> struct WvTraits {
22 static void release(From *obj) {
23 WvTraits_Helper<From, 0>::release(obj);
30 WvLink(bool, int) : autofree() {}
31 bool get_autofree() {}
39 WvListBase() : head(0, 0) {}
41 template<class T> struct WvList : WvListBase {
46 void zap(bool destroy = 1) {
47 while (head.next) unlink_after(&head, destroy);
50 void unlink_after(WvLink *after, bool destroy) {
52 T *obj = (destroy && next->get_autofree()) ?
53 static_cast<T*>(next->data) : 0;
55 if (tail) tail = after;
57 WvTraits<T>::release(obj);
60 typedef WvList<WvString>WvStringListBase;
61 class WvStringList : WvStringListBase {};
63 WvStringList last_args, env;
65 void addroute(WvIPNet& dest, WvStringParm table) {
66 if (dest.is_default() || (table != "default")) WvSubProc checkProc;