comparison graphics/weston/musl.patch @ 505:7828241c9634

graphics: convert packages to clang
author David Demelier <markand@malikania.fr>
date Tue, 09 Apr 2019 20:05:00 +0200
parents
children
comparison
equal deleted inserted replaced
504:162a9418ba15 505:7828241c9634
1 diff --git a/Makefile.am b/Makefile.am
2 index 5407b593ebb951031e79a70dda3b7dd555d1c8a9..5c6a051914a03ebe531e9c9a90b5cd199988a9a4 100644
3 --- a/Makefile.am
4 +++ b/Makefile.am
5 @@ -230,6 +230,7 @@ libsession_helper_la_SOURCES = \
6 libweston/launcher-util.c \
7 libweston/launcher-util.h \
8 libweston/launcher-impl.h \
9 + libweston/weston-error.h \
10 libweston/weston-launch.h \
11 libweston/launcher-weston-launch.c \
12 libweston/launcher-direct.c
13 diff --git a/configure.ac b/configure.ac
14 index c05ad01160040a0cb30d153858bbf0247f183a57..8cfec6871e5c2c9ac0df390b47c9d22ecea88ba4 100644
15 --- a/configure.ac
16 +++ b/configure.ac
17 @@ -126,6 +126,7 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
18 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
19 [[#include <time.h>]])
20
21 +AC_CHECK_HEADERS([error.h])
22 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
23
24 # check for libdrm as a build-time dependency only
25 diff --git a/libweston/weston-error.h b/libweston/weston-error.h
26 new file mode 100644
27 index 0000000000000000000000000000000000000000..bc7b95bda0a1772664d78119255b2e966cab8a15
28 --- /dev/null
29 +++ b/libweston/weston-error.h
30 @@ -0,0 +1,22 @@
31 +#ifndef _WESTON_ERROR_H
32 +#define _WESTON_ERROR_H
33 +
34 +#if defined(HAVE_ERROR_H)
35 +#include <error.h>
36 +#else
37 +#include <string.h>
38 +#define _weston_error(S, E, F, ...) do { \
39 + if (E) { \
40 + printf("\n"); \
41 + fprintf(stderr, F ": %s", ##__VA_ARGS__, strerror(E)); \
42 + exit(S); \
43 + } else { \
44 + printf("\n"); \
45 + fprintf(stderr, F, ##__VA_ARGS__); \
46 + exit(S); }\
47 +} while(0)
48 +
49 +#define error _weston_error
50 +#endif
51 +
52 +#endif
53 diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
54 index bf73e0d616a0d0efc228909c48bcb6b3ad6660ca..90644394309f3ee7e33bc7fafc2f3150f0a8d2b3 100644
55 --- a/libweston/weston-launch.c
56 +++ b/libweston/weston-launch.c
57 @@ -33,7 +33,6 @@
58 #include <poll.h>
59 #include <errno.h>
60
61 -#include <error.h>
62 #include <getopt.h>
63
64 #include <sys/types.h>
65 @@ -59,6 +58,7 @@
66 #endif
67
68 #include "weston-launch.h"
69 +#include "weston-error.h"
70
71 #define DRM_MAJOR 226
72