X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/c771a55e40d2a41d607a0da1b67cd1f7d546ccc8..6f21403d553131b282aeff52a2c496d71d05c97e:/misc.h?ds=sidebyside diff --git a/misc.h b/misc.h index aee128e..e58ac61 100644 --- a/misc.h +++ b/misc.h @@ -3,6 +3,13 @@ #include +/* Returns c-string "s" if n > 1, empty string "" otherwise. */ +#define ESSE(n) (misc::str_esse + ((n) <= 1)) + +namespace misc { + extern const char str_esse[]; +} + /* Returns true if the given priority is enabled for the default * category. Priority is xbt_log_priority_SUFFIX, where SUFFIX may * be: trace, debug, verbose, info, warning, error, critical. @@ -10,12 +17,18 @@ #define LOG_ISENABLED(priority) \ (_XBT_LOG_ISENABLEDV((*_XBT_LOGV(default)), (priority))) -/* Returns c-string "s" if n > 1, empty string "" otherwise. */ -#define ESSE(n) ((n) > 1 ? misc::str_esse : misc::str_nil) -namespace misc { - extern const char str_esse[]; - extern const char str_nil[]; -} +/* Defines XBT_XCLOG(...) which behave like XBT_CLOG(...), except that the + * given category is not passed through _XBT_LOGV before use. + */ +#define XBT_XCLOG(c, p, ...) XBT_CLOG_((*(c)), p, __VA_ARGS__) + +/* Use a faster version of TRY if available. + */ +#if defined(TRY_NO_BACKTRACE) +# define TRY_FAST TRY_NO_BACKTRACE +#else +# define TRY_FAST TRY +#endif #endif // !MISC_H