X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Fusterr.h;h=dc151b0aae2002504422d705966416fe5868f619;hb=refs%2Fheads%2Fstable-2.2;hp=86c9bf866a256dcff7f2b2ae6bf9893381db702a;hpb=49c0da7df5e7bd32c06d69822e9b92120bf4d392;p=lttng-ust.git diff --git a/include/usterr.h b/include/usterr.h index 86c9bf86..dc151b0a 100644 --- a/include/usterr.h +++ b/include/usterr.h @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -87,7 +86,10 @@ static inline int ust_debug(void) #define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args) #define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args) -#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE) +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) +/* + * Version using XSI strerror_r. + */ #define PERROR(call, args...)\ do { \ char buf[200] = "Error in strerror_r()"; \ @@ -95,6 +97,9 @@ static inline int ust_debug(void) ERRMSG("Error: " call ": %s", ## args, buf); \ } while(0); #else +/* + * Version using GNU strerror_r, for linux with appropriate defines. + */ #define PERROR(call, args...)\ do { \ char *buf; \