X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/db6a637e93b0b8298aeff749d1b6b2796ded50ad..7f1b38703bd4420a5582df4f0ddf9fea3e3d77ad:/include/xbt/sysdep.h diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index 99f82a345d..4e407abb99 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -35,7 +35,7 @@ SG_BEGIN_DECL() * @{ */ /** @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 @@ -54,16 +54,20 @@ 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 */ #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(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) @@ -71,14 +75,8 @@ XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2); * @{ */ -#ifdef _MSC_VER /* Microsoft wants to improve the code quality blah blah blah */ -/* See: https://msdn.microsoft.com/en-us/library/8ef0s5kh.aspx */ - -/* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */ -# define _CRT_NONSTDC_NO_WARNINGS -# define strdup _strdup -/* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */ -# define _CRT_SECURE_NO_WARNINGS +#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 */