screenshooter: Only link to $(CLIENT_LIBS) not libtoytoolkit.la
This application doesn't use toytoolkit, so don't link to it. We have to add a copy of xmalloc, to link without toytoolkit.
This commit is contained in:
+4
-2
@@ -109,8 +109,10 @@ weston_flower_LDADD = libtoytoolkit.la
|
|||||||
weston_screenshooter_SOURCES = \
|
weston_screenshooter_SOURCES = \
|
||||||
screenshot.c \
|
screenshot.c \
|
||||||
screenshooter-protocol.c \
|
screenshooter-protocol.c \
|
||||||
screenshooter-client-protocol.h
|
screenshooter-client-protocol.h \
|
||||||
weston_screenshooter_LDADD = libtoytoolkit.la
|
../shared/os-compatibility.c \
|
||||||
|
../shared/os-compatibility.h
|
||||||
|
weston_screenshooter_LDADD = $(CLIENT_LIBS)
|
||||||
|
|
||||||
weston_terminal_SOURCES = terminal.c
|
weston_terminal_SOURCES = terminal.c
|
||||||
weston_terminal_LDADD = libtoytoolkit.la -lutil
|
weston_terminal_LDADD = libtoytoolkit.la -lutil
|
||||||
|
|||||||
+19
-1
@@ -20,7 +20,10 @@
|
|||||||
* OF THIS SOFTWARE.
|
* OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -75,6 +78,21 @@ display_handle_geometry(void *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
xmalloc(size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = malloc(size);
|
||||||
|
if (p == NULL) {
|
||||||
|
fprintf(stderr, "%s: out of memory\n",
|
||||||
|
program_invocation_short_name);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
display_handle_mode(void *data,
|
display_handle_mode(void *data,
|
||||||
struct wl_output *wl_output,
|
struct wl_output *wl_output,
|
||||||
@@ -185,7 +203,7 @@ write_png(int width, int height)
|
|||||||
|
|
||||||
buffer_stride = width * 4;
|
buffer_stride = width * 4;
|
||||||
|
|
||||||
data = malloc(buffer_stride * height);
|
data = xmalloc(buffer_stride * height);
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user