clients & tests: Unify multiple definitions of x*alloc and related functions
Direct fail_on_null calls now produce output like:
[weston-info] clients/weston-info.c:714: out of memory
xmalloc, et al produce output on failure like:
[weston-info] out of memory (-1)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/clients/multi-resource.c b/clients/multi-resource.c
index 4ed4d50..b061e68 100644
--- a/clients/multi-resource.c
+++ b/clients/multi-resource.c
@@ -40,6 +40,7 @@
#include <wayland-client.h>
#include "shared/os-compatibility.h"
+#include "shared/xalloc.h"
#include "shared/zalloc.h"
struct device {
@@ -83,20 +84,6 @@
buffer_release
};
-static inline void *
-xzalloc(size_t s)
-{
- void *p;
-
- p = zalloc(s);
- if (p == NULL) {
- fprintf(stderr, "%s: out of memory\n", program_invocation_short_name);
- exit(EXIT_FAILURE);
- }
-
- return p;
-}
-
static int
attach_buffer(struct window *window, int width, int height)
{