From ad4d53393fdc8da00b5495852fa51db3fa290943 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 28 Mar 2012 11:19:28 +0200 Subject: [PATCH] Declare needed categories in XBT_LOG_CONNECT macro. Also temporarily reactivate the assert in the non MSVC case, to check the compilation. --- include/xbt/log.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/xbt/log.h b/include/xbt/log.h index 79a85846d6..d1d7315eff 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -113,12 +113,20 @@ typedef enum { */ #if defined(_MSC_VER) # define _XBT_LOG_PARENT_INITIALIZER(parent) NULL -# define XBT_LOG_CONNECT(child, parent_cat) \ - _XBT_LOGV(child).parent = &_XBT_LOGV(parent_cat) +# define XBT_LOG_CONNECT(child, parent_cat) \ + if (1) { \ + XBT_LOG_EXTERNAL_CATEGORY(child); \ + XBT_LOG_EXTERNAL_CATEGORY(parent_cat); \ + _XBT_LOGV(child).parent = &_XBT_LOGV(parent_cat); \ + } else ((void)0) #else # define _XBT_LOG_PARENT_INITIALIZER(parent) &_XBT_LOGV(parent) # define XBT_LOG_CONNECT(child, parent_cat) \ - /* xbt_assert(_XBT_LOGV(child).parent == &_XBT_LOGV(parent_cat)) */ + if (1) { \ + XBT_LOG_EXTERNAL_CATEGORY(child); \ + XBT_LOG_EXTERNAL_CATEGORY(parent_cat); \ + xbt_assert(_XBT_LOGV(child).parent == &_XBT_LOGV(parent_cat)); \ + } else ((void)0) #endif /* XBT_LOG_NEW_SUBCATEGORY_helper: -- 2.20.1