diff --git a/include/dlist.h b/include/dlist.h index 9320bfd404a6cde971030fb74af0c4d57c9c8027..e67db21bdd710f8dd26235ac9ccf856879244fde 100644 --- a/include/dlist.h +++ b/include/dlist.h @@ -31,6 +31,7 @@ * 修改记录: 202105140816: 根据git的要求增加License + 202106080611: 增加了ListItemDetach宏,解决在Destroy中不能调用listDetach的问题 */ #ifndef __DLIST_H @@ -117,6 +118,14 @@ int dlistInsertAfter(HOBJECT after, HOBJECT item); */ int dlistDetach(HOBJECT item); +#define ListItemDetach(pobj) \ +do { \ + pobj->__dlist_pLast->__dlist_pNext = pobj->__dlist_pNext; \ + pobj->__dlist_pNext->__dlist_pLast = pobj->__dlist_pLast; \ + pobj->__dlist_pLast = pobj; \ + pobj->__dlist_pNext = pobj; \ +} while (0) + /* 得到表中项的个数 */ diff --git a/src/dlist.c b/src/dlist.c index 43202eeda65e985128206632c1c3f11e19e7d8d2..56765b8eb67c6d13cdbf81de91db69eb3e1fe8b6 100644 --- a/src/dlist.c +++ b/src/dlist.c @@ -243,7 +243,7 @@ QUERYINTERFACE_END static const char* dlistheaderModuleInfo() { - return "1.0.0-20210503.1247 Dual List Header"; + return "1.0.1-20210608.0612 Dual List Header"; } static int dlistheaderCreate(const PARAMITEM* pParams, int paramcount, HOBJECT* pObject)