Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to declare a log category and not use it right away; add XBT_LOG_EXTERNAL_DEFAU...
[simgrid.git] / include / xbt / log.h
index bb01150..886345f 100644 (file)
@@ -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);