ctf-fs: missing component->streams NULL check
[babeltrace.git] / include / babeltrace / babeltrace-internal.h
index 2f15a681a8db5ccdc550e9f8ba37d13474972295..9a91ba46736128bae32bb13daa62963198a52147 100644 (file)
@@ -27,6 +27,8 @@
 #include <stdio.h>
 #include <glib.h>
 #include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
 #include <babeltrace/compat/string.h>
 
 #define PERROR_BUFLEN  200
@@ -84,14 +86,14 @@ extern int babeltrace_verbose, babeltrace_debug;
 #define _bt_printf_perror(fp, fmt, args...)                            \
        ({                                                              \
                char buf[PERROR_BUFLEN] = "Error in strerror_r()";      \
-               compat_strerror_r(errno, buf, sizeof(buf));             \
+               bt_strerror_r(errno, buf, sizeof(buf));         \
                _bt_printfe(fp, "error", buf, fmt, ## args);            \
        })
 
 #define _bt_printfl_perror(fp, lineno, fmt, args...)                   \
        ({                                                              \
                char buf[PERROR_BUFLEN] = "Error in strerror_r()";      \
-               compat_strerror_r(errno, buf, sizeof(buf));             \
+               bt_strerror_r(errno, buf, sizeof(buf));         \
                _bt_printfle(fp, "error", lineno, buf, fmt, ## args);   \
        })
 
@@ -159,6 +161,16 @@ extern int babeltrace_verbose, babeltrace_debug;
 #define max(a, b)      (((a) > (b)) ? (a) : (b))
 #endif
 
+#ifndef max_t
+#define max_t(type, a, b)      \
+       ((type) (a) > (type) (b) ? (type) (a) : (type) (b))
+#endif
+
+/*
+ * Memory allocation zeroed
+ */
+#define zmalloc(x) calloc(1, x)
+
 /*
  * BT_HIDDEN: set the hidden attribute for internal functions
  */
This page took 0.023179 seconds and 4 git commands to generate.