X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/fc5dcac1115a7112e7ad9d67ce7fe233790e0887..596a21890fc3cae8f7ec57c76224b300c246ed1f:/misc.h diff --git a/misc.h b/misc.h index 1decbef..974f666 100644 --- a/misc.h +++ b/misc.h @@ -1,6 +1,7 @@ #ifndef MISC_H #define MISC_H +#include #include /* Returns true if the given priority is enabled for the default @@ -10,7 +11,25 @@ #define LOG_ISENABLED(priority) \ (_XBT_LOG_ISENABLEDV((*_XBT_LOGV(default)), (priority))) -#define ESSE(n) ((n) > 1 ? "s" : "") +/* Defines XCLOGn(...) which behave like CLOGn(...), except that the + * given category is not passed through _XBT_LOGV before use. + * (auto-generated, like its name says...) + */ +#include "misc_autogen.h" + +/* 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[]; + + template + struct address: public std::unary_function { + T* operator()(T& ref) { return &ref; } + }; + +} #endif // !MISC_H