Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Connect categories before the beginning of main().
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 30 Mar 2012 09:55:37 +0000 (11:55 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 30 Mar 2012 10:01:07 +0000 (12:01 +0200)
This allows to list the user defined categories with --help-log-categories.

Unfortunately, this feature is only available when using gcc.

include/xbt/log.h

index 56e9159..a398c40 100644 (file)
@@ -136,7 +136,7 @@ typedef enum {
  * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
  * XBT_LOG_NEW_CATEGORY */
 #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc)           \
  * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
  * XBT_LOG_NEW_CATEGORY */
 #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc)           \
-  XBT_PUBLIC(void) _XBT_LOGV_CTOR(catName)(void);                       \
+  XBT_PUBLIC(void) _XBT_LOGV_CTOR(catName)(void) _XBT_GNUC_CONSTRUCTOR(600); \
   void _XBT_LOGV_CTOR(catName)(void)                                    \
   {                                                                     \
     XBT_LOG_EXTERNAL_CATEGORY(catName);                                 \
   void _XBT_LOGV_CTOR(catName)(void)                                    \
   {                                                                     \
     XBT_LOG_EXTERNAL_CATEGORY(catName);                                 \