-#define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
- XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(catName) = { \
- _XBT_LOG_PARENT_INITIALIZER(parent), \
- NULL /* firstChild */, \
- NULL /* nextSibling */, \
- #catName, \
- desc, \
- 0 /*initialized */, \
- xbt_log_priority_uninitialized /* threshold */, \
- 1 /* isThreshInherited */, \
- NULL /* appender */, \
- NULL /* layout */, \
- 1 /* additivity */ \
- }
+#define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \
+ XBT_PUBLIC(void) _XBT_LOGV_CTOR(catName)(void); \
+ void _XBT_LOGV_CTOR(catName)(void) \
+ { \
+ XBT_LOG_EXTERNAL_CATEGORY(catName); \
+ /* Note: _XBT_LOGV(parent) should be already declared here. */ \
+ XBT_LOG_CONNECT_PARENT(catName, parent); \
+ _xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \
+ } \
+ XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(catName) = { \
+ _XBT_LOG_PARENT_INITIALIZER(parent), \
+ NULL /* firstChild */, \
+ NULL /* nextSibling */, \
+ #catName, \
+ desc, \
+ 0 /*initialized */, \
+ xbt_log_priority_uninitialized /* threshold */, \
+ 1 /* isThreshInherited */, \
+ NULL /* appender */, \
+ NULL /* layout */, \
+ 1 /* additivity */ \
+ }
+