Version 2.4.4
[lttng-ust.git] / include / usterr.h
index 86c9bf866a256dcff7f2b2ae6bf9893381db702a..fba07855333cdbd5d5966de05bf05f4fbf51baa0 100644 (file)
 
 #include <string.h>
 #include <sys/types.h>
-#include <sys/syscall.h>
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <urcu/compiler.h>
 
 #include "lttng/ust-tid.h"
 #include "share.h"
@@ -87,7 +87,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 +98,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; \
This page took 0.023733 seconds and 4 git commands to generate.