X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ffe8ce65fd9a8e18a0469f26f067c3ea6d5d60d4..b3b356352e87ae00a20f737c48e19b0c8413455a:/include/xbt/log.h diff --git a/include/xbt/log.h b/include/xbt/log.h index a4c4d8ac06..68132cf47e 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -1,6 +1,6 @@ /* log - a generic logging facility in the spirit of log4j */ -/* Copyright (c) 2004-2014. The SimGrid Team. +/* Copyright (c) 2004-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -131,7 +131,7 @@ typedef enum { * XBT_LOG_NEW_CATEGORY */ #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc) \ SG_BEGIN_DECL() \ - XBT_PUBLIC(void) _XBT_LOGV_CTOR(catName)(void) _XBT_LOGV_CTOR_ATTRIBUTE; \ + extern void _XBT_LOGV_CTOR(catName)(void) _XBT_LOGV_CTOR_ATTRIBUTE; \ void _XBT_LOGV_CTOR(catName)(void) \ { \ XBT_LOG_EXTERNAL_CATEGORY(catName); \ @@ -354,8 +354,16 @@ XBT_PUBLIC(int) _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority); +#ifdef DLL_EXPORT XBT_PUBLIC_DATA(s_xbt_log_category_t) _XBT_LOGV(XBT_LOG_ROOT_CAT); - +#else +// If we `dllexport` the root log category, MinGW does not want us to +// take its address with the error: +// > initializer element is not constant +// When using auto-import, MinGW is happy. +// We should handle this for non-root log categories as well. +extern s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT); +#endif extern xbt_log_appender_t xbt_log_default_appender; extern xbt_log_layout_t xbt_log_default_layout;