*/
#define xbt_die(...) \
do { \
- XBT_LOG_EXTERNAL_CATEGORY(xbt); \
XBT_CCRITICAL(xbt, __VA_ARGS__); \
xbt_abort(); \
} while (0)
/** @} */
+XBT_LOG_EXTERNAL_CATEGORY(xbt);
+
/* 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 */
#ifndef __USE_GNU /* do not redeclare existing headers */
{
char *res = NULL;
if (s) {
+# if !defined(_XBT_WIN32)
res = strdup(s);
+# else
+ res = _strdup(s);
+# endif
if (!res)
xbt_die("memory allocation error (strdup returned NULL)");
}
return res;
}
#else /* non __GNUC__ */
-# define xbt_strdup(s) strdup(s)
+# if !defined(_XBT_WIN32)
+# define xbt_strdup(s) strdup(s)
+# else
+# define xbt_strdup(s) _strdup(s)
+# endif
# define xbt_malloc(n) malloc(n)
# define xbt_malloc0(n) calloc(n,1)
# define xbt_realloc(p,s) realloc(p,s)