From: robertc <> Date: Fri, 13 Dec 2002 10:43:37 +0000 (+0000) Subject: assistance defines for classes that are both refcounted and cbdata'd X-Git-Tag: SQUID_3_0_PRE1~495 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6e251d8fcb626659b627b74bb28715f914bda23;p=thirdparty%2Fsquid.git assistance defines for classes that are both refcounted and cbdata'd --- diff --git a/src/defines.h b/src/defines.h index 2c3490c4b4..c7ed12613b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.109 2002/10/13 20:35:00 robertc Exp $ + * $Id: defines.h,v 1.110 2002/12/13 03:43:37 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -291,6 +291,8 @@ #endif #define cbdataReference(var) (cbdataInternalLock(var), var) #define cbdataReferenceDone(var) do {if (var) {cbdataInternalUnlock(var); var = NULL;}} while(0) +#define CBDATA_CLASS(type) static cbdata_type CBDATA_##type +#define CBDATA_CLASS_INIT(type) cbdata_type type::CBDATA_##type = CBDATA_UNKNOWN #define CBDATA_TYPE(type) static cbdata_type CBDATA_##type = CBDATA_UNKNOWN #define CBDATA_GLOBAL_TYPE(type) cbdata_type CBDATA_##type #define CBDATA_INIT_TYPE(type) (CBDATA_##type ? CBDATA_UNKNOWN : (CBDATA_##type = cbdataInternalAddType(CBDATA_##type, #type, sizeof(type), NULL)))