From: mquinson Date: Tue, 25 Apr 2006 12:43:11 +0000 (+0000) Subject: Allow to declare a log category and not use it right away; add XBT_LOG_EXTERNAL_DEFAU... X-Git-Tag: v3.3~3172 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/02201118960697772e289bddc4ad32b78973fe36 Allow to declare a log category and not use it right away; add XBT_LOG_EXTERNAL_DEFAULT_CATEGORY to the defines git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2186 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/log.h b/include/xbt/log.h index bb01150ac6..886345f373 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -138,7 +138,7 @@ typedef enum { # define XBT_LOG_DEFAULT_CATEGORY(cname) #else # define XBT_LOG_DEFAULT_CATEGORY(cname) \ - static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname) + static xbt_log_category_t _XBT_LOGV(default) _XBT_GNUC_UNUSED = &_XBT_LOGV(cname) #endif /** @@ -180,6 +180,18 @@ typedef enum { #define XBT_LOG_EXTERNAL_CATEGORY(cname) \ extern s_xbt_log_category_t _XBT_LOGV(cname) +/** + * \ingroup XBT_log + * \param cname name of the cat + * \hideinitializer + * + * Indicates that the default category of this file was declared in another file. + */ + +#define XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(cname) \ + XBT_LOG_EXTERNAL_CATEGORY(cname);\ + XBT_LOG_DEFAULT_CATEGORY(cname) + /* Functions you may call */ extern void xbt_log_control_set(const char* cs);