001-handle-systems-missing-sys_cdefs.h.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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>
  5. This is a non-portable header, and we cannot expect it to be provided by
  6. the system libc (e.g. musl). We just need and rely on declaration that
  7. we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
  8. only ever assume that.
  9. Fixes: https://bugs.freedesktop.org/105281
  10. ---
  11. include/bsd/libutil.h | 4 ++++
  12. include/bsd/md5.h | 4 ++++
  13. include/bsd/nlist.h | 4 ++++
  14. include/bsd/readpassphrase.h | 4 ++++
  15. include/bsd/stdlib.h | 4 ++++
  16. include/bsd/string.h | 4 ++++
  17. include/bsd/stringlist.h | 5 +++++
  18. include/bsd/sys/queue.h | 4 ++++
  19. include/bsd/sys/tree.h | 4 ++++
  20. include/bsd/timeconv.h | 4 ++++
  21. include/bsd/vis.h | 4 ++++
  22. include/bsd/wchar.h | 4 ++++
  23. 12 files changed, 49 insertions(+)
  24. --- a/include/bsd/libutil.h
  25. +++ b/include/bsd/libutil.h
  26. @@ -40,7 +40,11 @@
  27. #define LIBBSD_LIBUTIL_H
  28. #include <features.h>
  29. +#ifdef LIBBSD_OVERLAY
  30. #include <sys/cdefs.h>
  31. +#else
  32. +#include <bsd/sys/cdefs.h>
  33. +#endif
  34. #include <sys/types.h>
  35. #include <stdint.h>
  36. #include <stdio.h>
  37. --- a/include/bsd/md5.h
  38. +++ b/include/bsd/md5.h
  39. @@ -27,7 +27,11 @@ typedef struct MD5Context {
  40. uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
  41. } MD5_CTX;
  42. +#ifdef LIBBSD_OVERLAY
  43. #include <sys/cdefs.h>
  44. +#else
  45. +#include <bsd/sys/cdefs.h>
  46. +#endif
  47. #include <sys/types.h>
  48. __BEGIN_DECLS
  49. --- a/include/bsd/nlist.h
  50. +++ b/include/bsd/nlist.h
  51. @@ -27,7 +27,11 @@
  52. #ifndef LIBBSD_NLIST_H
  53. #define LIBBSD_NLIST_H
  54. +#ifdef LIBBSD_OVERLAY
  55. #include <sys/cdefs.h>
  56. +#else
  57. +#include <bsd/sys/cdefs.h>
  58. +#endif
  59. struct nlist {
  60. union {
  61. --- a/include/bsd/readpassphrase.h
  62. +++ b/include/bsd/readpassphrase.h
  63. @@ -31,7 +31,11 @@
  64. #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */
  65. #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */
  66. +#ifdef LIBBSD_OVERLAY
  67. #include <sys/cdefs.h>
  68. +#else
  69. +#include <bsd/sys/cdefs.h>
  70. +#endif
  71. #include <sys/types.h>
  72. __BEGIN_DECLS
  73. --- a/include/bsd/stdlib.h
  74. +++ b/include/bsd/stdlib.h
  75. @@ -42,7 +42,11 @@
  76. #ifndef LIBBSD_STDLIB_H
  77. #define LIBBSD_STDLIB_H
  78. +#ifdef LIBBSD_OVERLAY
  79. #include <sys/cdefs.h>
  80. +#else
  81. +#include <bsd/sys/cdefs.h>
  82. +#endif
  83. #include <sys/stat.h>
  84. #include <stdint.h>
  85. --- a/include/bsd/string.h
  86. +++ b/include/bsd/string.h
  87. @@ -33,7 +33,11 @@
  88. #ifndef LIBBSD_STRING_H
  89. #define LIBBSD_STRING_H
  90. +#ifdef LIBBSD_OVERLAY
  91. #include <sys/cdefs.h>
  92. +#else
  93. +#include <bsd/sys/cdefs.h>
  94. +#endif
  95. #include <sys/types.h>
  96. __BEGIN_DECLS
  97. --- a/include/bsd/stringlist.h
  98. +++ b/include/bsd/stringlist.h
  99. @@ -31,7 +31,12 @@
  100. #ifndef LIBBSD_STRINGLIST_H
  101. #define LIBBSD_STRINGLIST_H
  102. +
  103. +#ifdef LIBBSD_OVERLAY
  104. #include <sys/cdefs.h>
  105. +#else
  106. +#include <bsd/sys/cdefs.h>
  107. +#endif
  108. #include <sys/types.h>
  109. /*
  110. --- a/include/bsd/sys/queue.h
  111. +++ b/include/bsd/sys/queue.h
  112. @@ -33,7 +33,11 @@
  113. #ifndef LIBBSD_SYS_QUEUE_H
  114. #define LIBBSD_SYS_QUEUE_H
  115. +#ifdef LIBBSD_OVERLAY
  116. #include <sys/cdefs.h>
  117. +#else
  118. +#include <bsd/sys/cdefs.h>
  119. +#endif
  120. /*
  121. * This file defines four types of data structures: singly-linked lists,
  122. --- a/include/bsd/sys/tree.h
  123. +++ b/include/bsd/sys/tree.h
  124. @@ -30,7 +30,11 @@
  125. #ifndef LIBBSD_SYS_TREE_H
  126. #define LIBBSD_SYS_TREE_H
  127. +#ifdef LIBBSD_OVERLAY
  128. #include <sys/cdefs.h>
  129. +#else
  130. +#include <bsd/sys/cdefs.h>
  131. +#endif
  132. /*
  133. * This file defines data structures for different types of trees:
  134. --- a/include/bsd/timeconv.h
  135. +++ b/include/bsd/timeconv.h
  136. @@ -41,7 +41,11 @@
  137. #ifndef LIBBSD_TIMECONV_H
  138. #define LIBBSD_TIMECONV_H
  139. +#ifdef LIBBSD_OVERLAY
  140. #include <sys/cdefs.h>
  141. +#else
  142. +#include <bsd/sys/cdefs.h>
  143. +#endif
  144. #include <stdint.h>
  145. #include <time.h>
  146. --- a/include/bsd/vis.h
  147. +++ b/include/bsd/vis.h
  148. @@ -72,7 +72,11 @@
  149. */
  150. #define UNVIS_END 1 /* no more characters */
  151. +#ifdef LIBBSD_OVERLAY
  152. #include <sys/cdefs.h>
  153. +#else
  154. +#include <bsd/sys/cdefs.h>
  155. +#endif
  156. __BEGIN_DECLS
  157. char *vis(char *, int, int, int);
  158. --- a/include/bsd/wchar.h
  159. +++ b/include/bsd/wchar.h
  160. @@ -40,7 +40,11 @@
  161. #define LIBBSD_WCHAR_H
  162. #include <stddef.h>
  163. +#ifdef LIBBSD_OVERLAY
  164. #include <sys/cdefs.h>
  165. +#else
  166. +#include <bsd/sys/cdefs.h>
  167. +#endif
  168. #include <sys/types.h>
  169. __BEGIN_DECLS