Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MSVC] don't declare the 'xbt' log channel both extern and local in xbt_main.c
[simgrid.git] / include / xbt / sysdep.h
index d990aaa..bffd706 100644 (file)
@@ -54,7 +54,11 @@ XBT_PUBLIC(void) xbt_abort(void) _XBT_GNUC_NORETURN;
   } while (0)
 /** @} */
 
+#ifdef XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL
+XBT_LOG_NEW_CATEGORY(xbt, "All XBT categories (simgrid toolbox)");
+#else
 XBT_LOG_EXTERNAL_CATEGORY(xbt);
+#endif
 
 /* these ones live in str.h, but redeclare them here so that we do
    not need to load the whole str.h and its heavy dependencies */
@@ -71,6 +75,10 @@ XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
  *  @{
  */
 
+#if defined(_MSC_VER) && !defined(strdup)
+#  define strdup _strdup /* POSIX name is not ANSI complient blabla */
+#endif
+
 /** @brief Like strdup, but xbt_die() on error */
 static XBT_ALWAYS_INLINE char *xbt_strdup(const char *s) {
   char *res = NULL;