0001-Add-feature-macros-to-more-C-files.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. From 7854cd141f6f4c896afdc86229671d443ca7ba10 Mon Sep 17 00:00:00 2001
  2. From: Paul Cercueil <paul@crapouillou.net>
  3. Date: Thu, 18 Feb 2021 22:31:39 +0000
  4. Subject: [PATCH] Add feature macros to more C files
  5. These source files use "struct timespec", which is POSIX 1993.09.
  6. Upstream: Rejected (Upstream does not want these workarounds)
  7. see: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2493
  8. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  9. [Retrieved from: https://github.com/swaywm/wlroots/pull/2493]
  10. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  11. [Julien: refreshed the patch to be applied with fuzz factor 0]
  12. Signed-off-by: Julien Olivain <ju.o@free.fr>
  13. ---
  14. backend/wayland/output.c | 1 +
  15. types/data_device/wlr_data_device.c | 1 +
  16. types/data_device/wlr_drag.c | 1 +
  17. types/wlr_export_dmabuf_v1.c | 1 +
  18. types/wlr_idle.c | 1 +
  19. types/wlr_keyboard_shortcuts_inhibit_v1.c | 1 +
  20. types/wlr_pointer_constraints_v1.c | 1 +
  21. types/wlr_primary_selection.c | 1 +
  22. types/wlr_relative_pointer_v1.c | 1 +
  23. types/wlr_screencopy_v1.c | 1 +
  24. types/wlr_virtual_pointer_v1.c | 1 +
  25. types/wlr_xdg_decoration_v1.c | 1 +
  26. types/xdg_shell/wlr_xdg_popup.c | 1 +
  27. types/xdg_shell/wlr_xdg_positioner.c | 1 +
  28. types/xdg_shell/wlr_xdg_shell.c | 1 +
  29. types/xdg_shell/wlr_xdg_surface.c | 1 +
  30. 16 files changed, 16 insertions(+)
  31. diff --git a/backend/wayland/output.c b/backend/wayland/output.c
  32. index c4b95e1..d5699d3 100644
  33. --- a/backend/wayland/output.c
  34. +++ b/backend/wayland/output.c
  35. @@ -1,3 +1,4 @@
  36. +#define _POSIX_C_SOURCE 199309L
  37. #include <assert.h>
  38. #include <stdint.h>
  39. #include <stdio.h>
  40. diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
  41. index 7e67479..2db13a6 100644
  42. --- a/types/data_device/wlr_data_device.c
  43. +++ b/types/data_device/wlr_data_device.c
  44. @@ -1,3 +1,4 @@
  45. +#define _POSIX_C_SOURCE 199309L
  46. #include <assert.h>
  47. #include <stdlib.h>
  48. #include <string.h>
  49. diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
  50. index c1fa801..8981ea0 100644
  51. --- a/types/data_device/wlr_drag.c
  52. +++ b/types/data_device/wlr_drag.c
  53. @@ -1,3 +1,4 @@
  54. +#define _POSIX_C_SOURCE 199309L
  55. #include <assert.h>
  56. #include <stdlib.h>
  57. #include <string.h>
  58. diff --git a/types/wlr_export_dmabuf_v1.c b/types/wlr_export_dmabuf_v1.c
  59. index c1d26e6..cd06615 100644
  60. --- a/types/wlr_export_dmabuf_v1.c
  61. +++ b/types/wlr_export_dmabuf_v1.c
  62. @@ -1,3 +1,4 @@
  63. +#define _POSIX_C_SOURCE 199309L
  64. #include <assert.h>
  65. #include <stdlib.h>
  66. #include <unistd.h>
  67. diff --git a/types/wlr_idle.c b/types/wlr_idle.c
  68. index cb3a1cc..5f1fa95 100644
  69. --- a/types/wlr_idle.c
  70. +++ b/types/wlr_idle.c
  71. @@ -1,3 +1,4 @@
  72. +#define _POSIX_C_SOURCE 199309L
  73. #include <assert.h>
  74. #include <stdlib.h>
  75. #include <string.h>
  76. diff --git a/types/wlr_keyboard_shortcuts_inhibit_v1.c b/types/wlr_keyboard_shortcuts_inhibit_v1.c
  77. index cc9bac1..3924893 100644
  78. --- a/types/wlr_keyboard_shortcuts_inhibit_v1.c
  79. +++ b/types/wlr_keyboard_shortcuts_inhibit_v1.c
  80. @@ -1,3 +1,4 @@
  81. +#define _POSIX_C_SOURCE 199309L
  82. #include <assert.h>
  83. #include <stdlib.h>
  84. #include <wlr/types/wlr_compositor.h>
  85. diff --git a/types/wlr_pointer_constraints_v1.c b/types/wlr_pointer_constraints_v1.c
  86. index 7a8d209..70b0984 100644
  87. --- a/types/wlr_pointer_constraints_v1.c
  88. +++ b/types/wlr_pointer_constraints_v1.c
  89. @@ -1,3 +1,4 @@
  90. +#define _POSIX_C_SOURCE 199309L
  91. #include <assert.h>
  92. #include <limits.h>
  93. #include <pixman.h>
  94. diff --git a/types/wlr_primary_selection.c b/types/wlr_primary_selection.c
  95. index d576bf0..bac4daa 100644
  96. --- a/types/wlr_primary_selection.c
  97. +++ b/types/wlr_primary_selection.c
  98. @@ -1,3 +1,4 @@
  99. +#define _POSIX_C_SOURCE 199309L
  100. #include <assert.h>
  101. #include <stdlib.h>
  102. #include <wlr/types/wlr_primary_selection.h>
  103. diff --git a/types/wlr_relative_pointer_v1.c b/types/wlr_relative_pointer_v1.c
  104. index 44da791..f6925b8 100644
  105. --- a/types/wlr_relative_pointer_v1.c
  106. +++ b/types/wlr_relative_pointer_v1.c
  107. @@ -1,3 +1,4 @@
  108. +#define _POSIX_C_SOURCE 199309L
  109. #include <assert.h>
  110. #include <inttypes.h>
  111. #include <stdlib.h>
  112. diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
  113. index 4ca659a..76c582e 100644
  114. --- a/types/wlr_screencopy_v1.c
  115. +++ b/types/wlr_screencopy_v1.c
  116. @@ -1,3 +1,4 @@
  117. +#define _POSIX_C_SOURCE 199309L
  118. #include <assert.h>
  119. #include <stdlib.h>
  120. #include <drm_fourcc.h>
  121. diff --git a/types/wlr_virtual_pointer_v1.c b/types/wlr_virtual_pointer_v1.c
  122. index b452ff5..661e613 100644
  123. --- a/types/wlr_virtual_pointer_v1.c
  124. +++ b/types/wlr_virtual_pointer_v1.c
  125. @@ -1,3 +1,4 @@
  126. +#define _POSIX_C_SOURCE 199309L
  127. #include <assert.h>
  128. #include <stdlib.h>
  129. #include <wlr/interfaces/wlr_pointer.h>
  130. diff --git a/types/wlr_xdg_decoration_v1.c b/types/wlr_xdg_decoration_v1.c
  131. index fcd97a5..1850665 100644
  132. --- a/types/wlr_xdg_decoration_v1.c
  133. +++ b/types/wlr_xdg_decoration_v1.c
  134. @@ -1,3 +1,4 @@
  135. +#define _POSIX_C_SOURCE 199309L
  136. #include <assert.h>
  137. #include <stdbool.h>
  138. #include <stdlib.h>
  139. diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
  140. index fa99acd..8361eef 100644
  141. --- a/types/xdg_shell/wlr_xdg_popup.c
  142. +++ b/types/xdg_shell/wlr_xdg_popup.c
  143. @@ -1,3 +1,4 @@
  144. +#define _POSIX_C_SOURCE 199309L
  145. #include <assert.h>
  146. #include <stdlib.h>
  147. #include <string.h>
  148. diff --git a/types/xdg_shell/wlr_xdg_positioner.c b/types/xdg_shell/wlr_xdg_positioner.c
  149. index 6a991bb..dae879b 100644
  150. --- a/types/xdg_shell/wlr_xdg_positioner.c
  151. +++ b/types/xdg_shell/wlr_xdg_positioner.c
  152. @@ -1,3 +1,4 @@
  153. +#define _POSIX_C_SOURCE 199309L
  154. #include <assert.h>
  155. #include <stdlib.h>
  156. #include <wlr/util/edges.h>
  157. diff --git a/types/xdg_shell/wlr_xdg_shell.c b/types/xdg_shell/wlr_xdg_shell.c
  158. index 70b777d..16d275a 100644
  159. --- a/types/xdg_shell/wlr_xdg_shell.c
  160. +++ b/types/xdg_shell/wlr_xdg_shell.c
  161. @@ -1,3 +1,4 @@
  162. +#define _POSIX_C_SOURCE 199309L
  163. #include <assert.h>
  164. #include <stdlib.h>
  165. #include "types/wlr_xdg_shell.h"
  166. diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c
  167. index a03b90a..a6267cf 100644
  168. --- a/types/xdg_shell/wlr_xdg_surface.c
  169. +++ b/types/xdg_shell/wlr_xdg_surface.c
  170. @@ -1,3 +1,4 @@
  171. +#define _POSIX_C_SOURCE 199309L
  172. #include <assert.h>
  173. #include <stdlib.h>
  174. #include <string.h>
  175. --
  176. 2.45.2