X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ffatal.hpp;h=7a8ce5161491173670359ed67ca08dad9a807478;hb=85b7bde8fee1a43ace784690188e2f4c62f89825;hp=54f672b652a8808973de15800def96a430e8d009;hpb=f363012dbad70fe0d1e6d714f432e1567cef4935;p=m6w6%2Flibmemcached diff --git a/libtest/fatal.hpp b/libtest/fatal.hpp index 54f672b6..7a8ce516 100644 --- a/libtest/fatal.hpp +++ b/libtest/fatal.hpp @@ -42,6 +42,13 @@ #define __PRETTY_FUNCTION__ __func__ #endif +#define YATL_STRINGIFY(x) #x +#define YATL_TOSTRING(x) YATL_STRINGIFY(x) +#define YATL_AT __FILE__ ":" YATL_TOSTRING(__LINE__) +#define YATL_AT_PARAM __func__, AT +#define YATL_UNIQUE __FILE__ ":" YATL_TOSTRING(__LINE__) "_unique" +#define YATL_UNIQUE_FUNC_NAME __FILE__ ":" YATL_TOSTRING(__LINE__) "_unique_func" + #define LIBYATL_DEFAULT_PARAM __FILE__, __LINE__, __PRETTY_FUNCTION__ namespace libtest { @@ -108,10 +115,28 @@ public: static uint32_t disabled_counter(); static void increment_disabled_counter(); + int line() + { + return _line; + } + + const char* file() + { + return _file; + } + + const char* func() + { + return _func; + } + private: char _error_message[BUFSIZ]; in_port_t _port; char _instance[1024]; + int _line; + const char* _file; + const char* _func; };