0003-Handle-systems-missing-sys-cdefs.h.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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: [PATCH] Handle systems missing <sys/cdefs.h>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This is a non-portable header, and we cannot expect it to be provided by
  9. the system libc (e.g. musl). We just need and rely on declaration that
  10. we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
  11. only ever assume that.
  12. Fixes: https://bugs.freedesktop.org/105281
  13. Backported from: 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd
  14. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  15. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  16. ---
  17. include/bsd/libutil.h | 4 ++++
  18. include/bsd/md5.h | 4 ++++
  19. include/bsd/nlist.h | 4 ++++
  20. include/bsd/readpassphrase.h | 4 ++++
  21. include/bsd/stdlib.h | 4 ++++
  22. include/bsd/string.h | 4 ++++
  23. include/bsd/stringlist.h | 5 +++++
  24. include/bsd/sys/queue.h | 4 ++++
  25. include/bsd/sys/tree.h | 4 ++++
  26. include/bsd/timeconv.h | 4 ++++
  27. include/bsd/vis.h | 4 ++++
  28. include/bsd/wchar.h | 4 ++++
  29. 12 files changed, 49 insertions(+)
  30. diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
  31. index 45b3b15..ccca29a 100644
  32. --- a/include/bsd/libutil.h
  33. +++ b/include/bsd/libutil.h
  34. @@ -40,7 +40,11 @@
  35. #define LIBBSD_LIBUTIL_H
  36. #include <features.h>
  37. +#ifdef LIBBSD_OVERLAY
  38. #include <sys/cdefs.h>
  39. +#else
  40. +#include <bsd/sys/cdefs.h>
  41. +#endif
  42. #include <sys/types.h>
  43. #include <stdint.h>
  44. #include <stdio.h>
  45. diff --git a/include/bsd/md5.h b/include/bsd/md5.h
  46. index 5f3ae46..bf36a30 100644
  47. --- a/include/bsd/md5.h
  48. +++ b/include/bsd/md5.h
  49. @@ -27,7 +27,11 @@ typedef struct MD5Context {
  50. uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
  51. } MD5_CTX;
  52. +#ifdef LIBBSD_OVERLAY
  53. #include <sys/cdefs.h>
  54. +#else
  55. +#include <bsd/sys/cdefs.h>
  56. +#endif
  57. #include <sys/types.h>
  58. __BEGIN_DECLS
  59. diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
  60. index cb297e8..8767117 100644
  61. --- a/include/bsd/nlist.h
  62. +++ b/include/bsd/nlist.h
  63. @@ -27,7 +27,11 @@
  64. #ifndef LIBBSD_NLIST_H
  65. #define LIBBSD_NLIST_H
  66. +#ifdef LIBBSD_OVERLAY
  67. #include <sys/cdefs.h>
  68. +#else
  69. +#include <bsd/sys/cdefs.h>
  70. +#endif
  71. struct nlist {
  72. union {
  73. diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
  74. index 14744b8..5eb8021 100644
  75. --- a/include/bsd/readpassphrase.h
  76. +++ b/include/bsd/readpassphrase.h
  77. @@ -31,7 +31,11 @@
  78. #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */
  79. #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */
  80. +#ifdef LIBBSD_OVERLAY
  81. #include <sys/cdefs.h>
  82. +#else
  83. +#include <bsd/sys/cdefs.h>
  84. +#endif
  85. #include <sys/types.h>
  86. __BEGIN_DECLS
  87. diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
  88. index ebc9638..8d33d1f 100644
  89. --- a/include/bsd/stdlib.h
  90. +++ b/include/bsd/stdlib.h
  91. @@ -42,7 +42,11 @@
  92. #ifndef LIBBSD_STDLIB_H
  93. #define LIBBSD_STDLIB_H
  94. +#ifdef LIBBSD_OVERLAY
  95. #include <sys/cdefs.h>
  96. +#else
  97. +#include <bsd/sys/cdefs.h>
  98. +#endif
  99. #include <sys/stat.h>
  100. #include <stdint.h>
  101. diff --git a/include/bsd/string.h b/include/bsd/string.h
  102. index 6798bf6..29097f6 100644
  103. --- a/include/bsd/string.h
  104. +++ b/include/bsd/string.h
  105. @@ -33,7 +33,11 @@
  106. #ifndef LIBBSD_STRING_H
  107. #define LIBBSD_STRING_H
  108. +#ifdef LIBBSD_OVERLAY
  109. #include <sys/cdefs.h>
  110. +#else
  111. +#include <bsd/sys/cdefs.h>
  112. +#endif
  113. #include <sys/types.h>
  114. __BEGIN_DECLS
  115. diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
  116. index ff30cac..dd71496 100644
  117. --- a/include/bsd/stringlist.h
  118. +++ b/include/bsd/stringlist.h
  119. @@ -31,7 +31,12 @@
  120. #ifndef LIBBSD_STRINGLIST_H
  121. #define LIBBSD_STRINGLIST_H
  122. +
  123. +#ifdef LIBBSD_OVERLAY
  124. #include <sys/cdefs.h>
  125. +#else
  126. +#include <bsd/sys/cdefs.h>
  127. +#endif
  128. #include <sys/types.h>
  129. /*
  130. diff --git a/include/bsd/sys/queue.h b/include/bsd/sys/queue.h
  131. index 4a94ea7..ac00026 100644
  132. --- a/include/bsd/sys/queue.h
  133. +++ b/include/bsd/sys/queue.h
  134. @@ -33,7 +33,11 @@
  135. #ifndef LIBBSD_SYS_QUEUE_H
  136. #define LIBBSD_SYS_QUEUE_H
  137. +#ifdef LIBBSD_OVERLAY
  138. #include <sys/cdefs.h>
  139. +#else
  140. +#include <bsd/sys/cdefs.h>
  141. +#endif
  142. /*
  143. * This file defines four types of data structures: singly-linked lists,
  144. diff --git a/include/bsd/sys/tree.h b/include/bsd/sys/tree.h
  145. index 628bec0..325b382 100644
  146. --- a/include/bsd/sys/tree.h
  147. +++ b/include/bsd/sys/tree.h
  148. @@ -30,7 +30,11 @@
  149. #ifndef LIBBSD_SYS_TREE_H
  150. #define LIBBSD_SYS_TREE_H
  151. +#ifdef LIBBSD_OVERLAY
  152. #include <sys/cdefs.h>
  153. +#else
  154. +#include <bsd/sys/cdefs.h>
  155. +#endif
  156. /*
  157. * This file defines data structures for different types of trees:
  158. diff --git a/include/bsd/timeconv.h b/include/bsd/timeconv.h
  159. index e2a2c55..a426bd3 100644
  160. --- a/include/bsd/timeconv.h
  161. +++ b/include/bsd/timeconv.h
  162. @@ -41,7 +41,11 @@
  163. #ifndef LIBBSD_TIMECONV_H
  164. #define LIBBSD_TIMECONV_H
  165. +#ifdef LIBBSD_OVERLAY
  166. #include <sys/cdefs.h>
  167. +#else
  168. +#include <bsd/sys/cdefs.h>
  169. +#endif
  170. #include <stdint.h>
  171. #include <time.h>
  172. diff --git a/include/bsd/vis.h b/include/bsd/vis.h
  173. index 970dfdd..ab5430c 100644
  174. --- a/include/bsd/vis.h
  175. +++ b/include/bsd/vis.h
  176. @@ -72,7 +72,11 @@
  177. */
  178. #define UNVIS_END 1 /* no more characters */
  179. +#ifdef LIBBSD_OVERLAY
  180. #include <sys/cdefs.h>
  181. +#else
  182. +#include <bsd/sys/cdefs.h>
  183. +#endif
  184. __BEGIN_DECLS
  185. char *vis(char *, int, int, int);
  186. diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
  187. index 33a500e..7216503 100644
  188. --- a/include/bsd/wchar.h
  189. +++ b/include/bsd/wchar.h
  190. @@ -40,7 +40,11 @@
  191. #define LIBBSD_WCHAR_H
  192. #include <stddef.h>
  193. +#ifdef LIBBSD_OVERLAY
  194. #include <sys/cdefs.h>
  195. +#else
  196. +#include <bsd/sys/cdefs.h>
  197. +#endif
  198. #include <sys/types.h>
  199. __BEGIN_DECLS
  200. --
  201. 2.17.0