X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=6fe8d8c2d3bc312d3670b2c55cef76bf42791e94;hp=0fbd3a2ed8ae19e8bc5db51a6275729eb8ab04ae;hb=e6142f2e647e83238b1e399b1264e8adb05409f9;hpb=ce69c47f5fb8cef80cf7ae8e766e4db354598e6d diff --git a/src/common/error.h b/src/common/error.h index 0fbd3a2ed..6fe8d8c2d 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #ifndef _GNU_SOURCE #error "lttng-tools error.h needs _GNU_SOURCE" @@ -153,6 +153,10 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) " - %s [%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" XSTR(__LINE__) ")\n", \ log_add_time(), (long) getpid(), (long) gettid(), ## args, __func__) +#define _ERRMSG_NO_LOC(msg, type, fmt, args...) __lttng_print(type, msg \ + " - %s [%ld/%ld]: " fmt "\n", \ + log_add_time(), (long) getpid(), (long) gettid(), ## args) + #define MSG(fmt, args...) \ __lttng_print(PRINT_MSG, fmt "\n", ## args) #define _MSG(fmt, args...) \ @@ -165,6 +169,7 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) #define BUG(fmt, args...) _ERRMSG("BUG", PRINT_BUG, fmt, ## args) #define DBG(fmt, args...) _ERRMSG("DEBUG1", PRINT_DBG, fmt, ## args) +#define DBG_NO_LOC(fmt, args...) _ERRMSG_NO_LOC("DEBUG1", PRINT_DBG, fmt, ## args) #define DBG2(fmt, args...) _ERRMSG("DEBUG2", PRINT_DBG2, fmt, ## args) #define DBG3(fmt, args...) _ERRMSG("DEBUG3", PRINT_DBG3, fmt, ## args) #define LOG(type, fmt, args...) \ @@ -198,7 +203,7 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) #define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ## args) -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) +#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) /* * Version using XSI strerror_r.