diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-25 19:25:46 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-25 19:25:46 +0000 |
commit | 87f0e9b5f91407418a43a06f39831febfbd4e3ad (patch) | |
tree | 810a4191b8cfd14a4a2a19399dbe894b16b5e6ae /obj-types.h | |
parent | 167abdb5b3fa6900edd6bbdb1cc7d586896a268c (diff) | |
download | rsyslog-87f0e9b5f91407418a43a06f39831febfbd4e3ad.tar.gz rsyslog-87f0e9b5f91407418a43a06f39831febfbd4e3ad.tar.xz rsyslog-87f0e9b5f91407418a43a06f39831febfbd4e3ad.zip |
disk-assisted queue mode finally begins to look good ;)
Diffstat (limited to 'obj-types.h')
-rw-r--r-- | obj-types.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/obj-types.h b/obj-types.h index 7eff503d..1e607d0c 100644 --- a/obj-types.h +++ b/obj-types.h @@ -100,16 +100,21 @@ typedef struct obj { /* the dummy struct that each derived class can be casted t objInfo_t *pObjInfo; \ unsigned int iObjCooCKiE; /* prevent name conflict, thus the strange name */ # define ISOBJ_assert(pObj) \ - { \ + do { \ + if(pObj == NULL) dbgPrintAllDebugInfo(); \ assert((pObj) != NULL); \ + if(((obj_t*)(pObj))->iObjCooCKiE != (unsigned) 0xBADEFEE) dbgPrintAllDebugInfo(); \ assert((unsigned) ((obj_t*)(pObj))->iObjCooCKiE == (unsigned) 0xBADEFEE); \ - } + } while(0); # define ISOBJ_TYPE_assert(pObj, objType) \ - { \ + do { \ + if(pObj == NULL) dbgPrintAllDebugInfo(); \ assert(pObj != NULL); \ + if(((obj_t*)(pObj))->iObjCooCKiE != (unsigned) 0xBADEFEE) dbgPrintAllDebugInfo(); \ assert((unsigned) pObj->iObjCooCKiE == (unsigned) 0xBADEFEE); \ + if(objGetObjID(pObj) != OBJ##objType) dbgPrintAllDebugInfo(); \ assert(objGetObjID(pObj) == OBJ##objType); \ - } + } while(0); #else /* non-debug mode, no checks but much faster */ # define BEGINobjInstance objInfo_t *pObjInfo; # define ISOBJ_TYPE_assert(pObj, objType) |