remove ia64 keywords
[gentoo-zh.git] / dev-libs / libratbag / files / libratbag-0.16-musl-error.h.patch
bloba3b0b187c154f51a3eed4cf8b653f3a32f68da9e
1 # Since musl doesn't provide error.h we need to check before adding it. If
2 # error.h is present in system only then we include it else we use err.h.
3 # Already there exists a bug report for this upstream [1]. The devs are open to
4 # a custom implementation of error but for now this patch for do it.
6 # [1]: https://github.com/libratbag/libratbag/issues/1253
8 # Closes: https://bugs.gentoo.org/830557
9 --- a/meson.build
10 +++ b/meson.build
11 @@ -74,8 +74,13 @@ dep_libevdev = dependency('libevdev')
12 dep_glib = dependency('glib-2.0')
13 dep_json_glib = dependency('json-glib-1.0')
14 dep_lm = cc.find_library('m')
15 +error_exists = cc.has_header('error.h')
16 dep_unistring = cc.find_library('unistring')
18 +if error_exists
19 + add_global_arguments('-DHAVE_ERROR_H', language : 'c')
20 +endif
22 if get_option('logind-provider') == 'elogind'
23 dep_logind = dependency('libelogind', version : '>=227')
24 else
25 --- a/tools/hidpp10-dump-page.c
26 +++ b/tools/hidpp10-dump-page.c
27 @@ -23,7 +23,12 @@
29 #include <config.h>
30 #include <errno.h>
31 +#ifdef HAVE_ERROR_H
32 #include <error.h>
33 +#else
34 +#include <err.h>
35 +#define error(status, errno, ...) err(status, __VA_ARGS__)
36 +#endif
37 #include <fcntl.h>
39 #include <hidpp10.h>
40 --- a/tools/hidpp20-dump-page.c
41 +++ b/tools/hidpp20-dump-page.c
42 @@ -23,7 +23,12 @@
44 #include <config.h>
45 #include <errno.h>
46 +#ifdef HAVE_ERROR_H
47 #include <error.h>
48 +#else
49 +#include <err.h>
50 +#define error(status, errno, ...) err(status, __VA_ARGS__)
51 +#endif
52 #include <fcntl.h>
54 #include <hidpp20.h>
55 --- a/tools/hidpp20-reset.c
56 +++ b/tools/hidpp20-reset.c
57 @@ -23,7 +23,12 @@
59 #include <config.h>
60 #include <errno.h>
61 +#ifdef HAVE_ERROR_H
62 #include <error.h>
63 +#else
64 +#include <err.h>
65 +#define error(status, errno, ...) err(status, __VA_ARGS__)
66 +#endif
67 #include <fcntl.h>
69 #include <hidpp20.h>