Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I think that MSVC wants the attrib before the symbol name
[simgrid.git] / include / xbt / sysdep.h
index d990aaa..4e407ab 100644 (file)
@@ -35,7 +35,7 @@ SG_BEGIN_DECL()
  * @{
  */
 /** @brief Kill the program in silence */
  * @{
  */
 /** @brief Kill the program in silence */
-XBT_PUBLIC(void) xbt_abort(void) _XBT_GNUC_NORETURN;
+XBT_PUBLIC(void) XBT_ATTRIB_NORETURN xbt_abort(void);
 
 /**
  * @brief Kill the program with an error message
 
 /**
  * @brief Kill the program with an error message
@@ -54,16 +54,20 @@ XBT_PUBLIC(void) xbt_abort(void) _XBT_GNUC_NORETURN;
   } while (0)
 /** @} */
 
   } 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);
 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 */
 #ifndef __USE_GNU               /* do not redeclare existing headers */
 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt,   /*args */
 
 /* 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 */
 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt,   /*args */
-                         ...) _XBT_GNUC_PRINTF(2, 3);
+                         ...) XBT_ATTRIB_PRINTF(2, 3);
 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
 #endif
 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
 #endif
-XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
+XBT_PUBLIC(char *) bprintf(const char *fmt, ...) XBT_ATTRIB_PRINTF(1, 2);
 
 /** @addtogroup XBT_syscall
  *  @brief Malloc and associated functions, killing the program on error (with \ref XBT_ex)
 
 /** @addtogroup XBT_syscall
  *  @brief Malloc and associated functions, killing the program on error (with \ref XBT_ex)
@@ -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;
 /** @brief Like strdup, but xbt_die() on error */
 static XBT_ALWAYS_INLINE char *xbt_strdup(const char *s) {
   char *res = NULL;