1 From 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd Mon Sep 17 00:00:00 2001
2 From: Guillem Jover <guillem@hadrons.org>
3 Date: Tue, 6 Mar 2018 01:41:35 +0100
4 Subject: Handle systems missing <sys/cdefs.h>
6 This is a non-portable header, and we cannot expect it to be provided by
7 the system libc (e.g. musl). We just need and rely on declaration that
8 we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
11 Fixes: https://bugs.freedesktop.org/105281
13 include/bsd/libutil.h | 4 ++++
14 include/bsd/md5.h | 4 ++++
15 include/bsd/nlist.h | 4 ++++
16 include/bsd/readpassphrase.h | 4 ++++
17 include/bsd/stdlib.h | 4 ++++
18 include/bsd/string.h | 4 ++++
19 include/bsd/stringlist.h | 5 +++++
20 include/bsd/sys/queue.h | 4 ++++
21 include/bsd/sys/tree.h | 4 ++++
22 include/bsd/timeconv.h | 4 ++++
23 include/bsd/vis.h | 4 ++++
24 include/bsd/wchar.h | 4 ++++
25 12 files changed, 49 insertions(+)
27 --- a/include/bsd/libutil.h
28 +++ b/include/bsd/libutil.h
30 #define LIBBSD_LIBUTIL_H
33 +#ifdef LIBBSD_OVERLAY
34 #include <sys/cdefs.h>
36 +#include <bsd/sys/cdefs.h>
38 #include <sys/types.h>
41 --- a/include/bsd/md5.h
42 +++ b/include/bsd/md5.h
43 @@ -27,7 +27,11 @@ typedef struct MD5Context {
44 uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
47 +#ifdef LIBBSD_OVERLAY
48 #include <sys/cdefs.h>
50 +#include <bsd/sys/cdefs.h>
52 #include <sys/types.h>
55 --- a/include/bsd/nlist.h
56 +++ b/include/bsd/nlist.h
58 #ifndef LIBBSD_NLIST_H
59 #define LIBBSD_NLIST_H
61 +#ifdef LIBBSD_OVERLAY
62 #include <sys/cdefs.h>
64 +#include <bsd/sys/cdefs.h>
69 --- a/include/bsd/readpassphrase.h
70 +++ b/include/bsd/readpassphrase.h
72 #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */
73 #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */
75 +#ifdef LIBBSD_OVERLAY
76 #include <sys/cdefs.h>
78 +#include <bsd/sys/cdefs.h>
80 #include <sys/types.h>
83 --- a/include/bsd/stdlib.h
84 +++ b/include/bsd/stdlib.h
86 #ifndef LIBBSD_STDLIB_H
87 #define LIBBSD_STDLIB_H
89 +#ifdef LIBBSD_OVERLAY
90 #include <sys/cdefs.h>
92 +#include <bsd/sys/cdefs.h>
97 --- a/include/bsd/string.h
98 +++ b/include/bsd/string.h
100 #ifndef LIBBSD_STRING_H
101 #define LIBBSD_STRING_H
103 +#ifdef LIBBSD_OVERLAY
104 #include <sys/cdefs.h>
106 +#include <bsd/sys/cdefs.h>
108 #include <sys/types.h>
111 --- a/include/bsd/stringlist.h
112 +++ b/include/bsd/stringlist.h
115 #ifndef LIBBSD_STRINGLIST_H
116 #define LIBBSD_STRINGLIST_H
118 +#ifdef LIBBSD_OVERLAY
119 #include <sys/cdefs.h>
121 +#include <bsd/sys/cdefs.h>
123 #include <sys/types.h>
126 --- a/include/bsd/sys/queue.h
127 +++ b/include/bsd/sys/queue.h
129 #ifndef LIBBSD_SYS_QUEUE_H
130 #define LIBBSD_SYS_QUEUE_H
132 +#ifdef LIBBSD_OVERLAY
133 #include <sys/cdefs.h>
135 +#include <bsd/sys/cdefs.h>
139 * This file defines four types of data structures: singly-linked lists,
140 --- a/include/bsd/sys/tree.h
141 +++ b/include/bsd/sys/tree.h
143 #ifndef LIBBSD_SYS_TREE_H
144 #define LIBBSD_SYS_TREE_H
146 +#ifdef LIBBSD_OVERLAY
147 #include <sys/cdefs.h>
149 +#include <bsd/sys/cdefs.h>
153 * This file defines data structures for different types of trees:
154 --- a/include/bsd/timeconv.h
155 +++ b/include/bsd/timeconv.h
157 #ifndef LIBBSD_TIMECONV_H
158 #define LIBBSD_TIMECONV_H
160 +#ifdef LIBBSD_OVERLAY
161 #include <sys/cdefs.h>
163 +#include <bsd/sys/cdefs.h>
168 --- a/include/bsd/vis.h
169 +++ b/include/bsd/vis.h
172 #define UNVIS_END 1 /* no more characters */
174 +#ifdef LIBBSD_OVERLAY
175 #include <sys/cdefs.h>
177 +#include <bsd/sys/cdefs.h>
181 char *vis(char *, int, int, int);
182 --- a/include/bsd/wchar.h
183 +++ b/include/bsd/wchar.h
185 #define LIBBSD_WCHAR_H
188 +#ifdef LIBBSD_OVERLAY
189 #include <sys/cdefs.h>
191 +#include <bsd/sys/cdefs.h>
193 #include <sys/types.h>