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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. From cf37ba4c0bf31316b698ba23015f91903766871d 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. ---
  12. backend/wayland/output.c | 1 +
  13. types/data_device/wlr_data_device.c | 1 +
  14. types/data_device/wlr_drag.c | 1 +
  15. types/wlr_export_dmabuf_v1.c | 1 +
  16. types/wlr_idle.c | 1 +
  17. types/wlr_keyboard_shortcuts_inhibit_v1.c | 1 +
  18. types/wlr_pointer_constraints_v1.c | 1 +
  19. types/wlr_primary_selection.c | 1 +
  20. types/wlr_relative_pointer_v1.c | 1 +
  21. types/wlr_screencopy_v1.c | 1 +
  22. types/wlr_virtual_pointer_v1.c | 1 +
  23. types/wlr_xdg_decoration_v1.c | 1 +
  24. types/xdg_shell/wlr_xdg_popup.c | 1 +
  25. types/xdg_shell/wlr_xdg_positioner.c | 1 +
  26. types/xdg_shell/wlr_xdg_shell.c | 1 +
  27. types/xdg_shell/wlr_xdg_surface.c | 1 +
  28. 16 files changed, 16 insertions(+)
  29. diff --git a/backend/wayland/output.c b/backend/wayland/output.c
  30. index d5410e0d32..8ff8fa2a00 100644
  31. --- a/backend/wayland/output.c
  32. +++ b/backend/wayland/output.c
  33. @@ -1,3 +1,4 @@
  34. +#define _POSIX_C_SOURCE 199309L
  35. #include <assert.h>
  36. #include <stdint.h>
  37. #include <stdio.h>
  38. diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
  39. index 6cd84ec0ab..beac496124 100644
  40. --- a/types/data_device/wlr_data_device.c
  41. +++ b/types/data_device/wlr_data_device.c
  42. @@ -1,3 +1,4 @@
  43. +#define _POSIX_C_SOURCE 199309L
  44. #include <assert.h>
  45. #include <stdlib.h>
  46. #include <string.h>
  47. diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
  48. index 53bf4066a1..e3c1e249b4 100644
  49. --- a/types/data_device/wlr_drag.c
  50. +++ b/types/data_device/wlr_drag.c
  51. @@ -1,3 +1,4 @@
  52. +#define _POSIX_C_SOURCE 199309L
  53. #include <assert.h>
  54. #include <stdlib.h>
  55. #include <string.h>
  56. diff --git a/types/wlr_export_dmabuf_v1.c b/types/wlr_export_dmabuf_v1.c
  57. index a8e2a4bde3..98ceae68f1 100644
  58. --- a/types/wlr_export_dmabuf_v1.c
  59. +++ b/types/wlr_export_dmabuf_v1.c
  60. @@ -1,3 +1,4 @@
  61. +#define _POSIX_C_SOURCE 199309L
  62. #include <assert.h>
  63. #include <stdlib.h>
  64. #include <unistd.h>
  65. diff --git a/types/wlr_idle.c b/types/wlr_idle.c
  66. index 4c338931cc..80fd871fab 100644
  67. --- a/types/wlr_idle.c
  68. +++ b/types/wlr_idle.c
  69. @@ -1,3 +1,4 @@
  70. +#define _POSIX_C_SOURCE 199309L
  71. #include <assert.h>
  72. #include <stdlib.h>
  73. #include <string.h>
  74. diff --git a/types/wlr_keyboard_shortcuts_inhibit_v1.c b/types/wlr_keyboard_shortcuts_inhibit_v1.c
  75. index fe4e64b04e..8360a9c21c 100644
  76. --- a/types/wlr_keyboard_shortcuts_inhibit_v1.c
  77. +++ b/types/wlr_keyboard_shortcuts_inhibit_v1.c
  78. @@ -1,3 +1,4 @@
  79. +#define _POSIX_C_SOURCE 199309L
  80. #include <assert.h>
  81. #include <stdlib.h>
  82. #include <util/signal.h>
  83. diff --git a/types/wlr_pointer_constraints_v1.c b/types/wlr_pointer_constraints_v1.c
  84. index eca45984c4..f1db8e3415 100644
  85. --- a/types/wlr_pointer_constraints_v1.c
  86. +++ b/types/wlr_pointer_constraints_v1.c
  87. @@ -1,3 +1,4 @@
  88. +#define _POSIX_C_SOURCE 199309L
  89. #include <assert.h>
  90. #include <limits.h>
  91. #include <pixman.h>
  92. diff --git a/types/wlr_primary_selection.c b/types/wlr_primary_selection.c
  93. index 0875462c8c..7e0e11ddaa 100644
  94. --- a/types/wlr_primary_selection.c
  95. +++ b/types/wlr_primary_selection.c
  96. @@ -1,3 +1,4 @@
  97. +#define _POSIX_C_SOURCE 199309L
  98. #include <assert.h>
  99. #include <stdlib.h>
  100. #include <wlr/types/wlr_primary_selection.h>
  101. diff --git a/types/wlr_relative_pointer_v1.c b/types/wlr_relative_pointer_v1.c
  102. index 8613f2b91c..3f8dd8b72a 100644
  103. --- a/types/wlr_relative_pointer_v1.c
  104. +++ b/types/wlr_relative_pointer_v1.c
  105. @@ -1,3 +1,4 @@
  106. +#define _POSIX_C_SOURCE 199309L
  107. #include <assert.h>
  108. #include <inttypes.h>
  109. #include <stdlib.h>
  110. diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
  111. index 6feb074274..29864c2364 100644
  112. --- a/types/wlr_screencopy_v1.c
  113. +++ b/types/wlr_screencopy_v1.c
  114. @@ -1,3 +1,4 @@
  115. +#define _POSIX_C_SOURCE 199309L
  116. #include <assert.h>
  117. #include <stdlib.h>
  118. #include <drm_fourcc.h>
  119. diff --git a/types/wlr_virtual_pointer_v1.c b/types/wlr_virtual_pointer_v1.c
  120. index a9d1fd7bc4..5566e9e013 100644
  121. --- a/types/wlr_virtual_pointer_v1.c
  122. +++ b/types/wlr_virtual_pointer_v1.c
  123. @@ -1,3 +1,4 @@
  124. +#define _POSIX_C_SOURCE 199309L
  125. #include <assert.h>
  126. #include <stdlib.h>
  127. #include <wlr/types/wlr_seat.h>
  128. diff --git a/types/wlr_xdg_decoration_v1.c b/types/wlr_xdg_decoration_v1.c
  129. index 544035b7b8..904474c088 100644
  130. --- a/types/wlr_xdg_decoration_v1.c
  131. +++ b/types/wlr_xdg_decoration_v1.c
  132. @@ -1,3 +1,4 @@
  133. +#define _POSIX_C_SOURCE 199309L
  134. #include <assert.h>
  135. #include <stdbool.h>
  136. #include <stdlib.h>
  137. diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
  138. index 69b4cfe19f..05d6551fc8 100644
  139. --- a/types/xdg_shell/wlr_xdg_popup.c
  140. +++ b/types/xdg_shell/wlr_xdg_popup.c
  141. @@ -1,3 +1,4 @@
  142. +#define _POSIX_C_SOURCE 199309L
  143. #include <assert.h>
  144. #include <stdlib.h>
  145. #include <string.h>
  146. diff --git a/types/xdg_shell/wlr_xdg_positioner.c b/types/xdg_shell/wlr_xdg_positioner.c
  147. index f88bf323b8..8881c49916 100644
  148. --- a/types/xdg_shell/wlr_xdg_positioner.c
  149. +++ b/types/xdg_shell/wlr_xdg_positioner.c
  150. @@ -1,3 +1,4 @@
  151. +#define _POSIX_C_SOURCE 199309L
  152. #include <assert.h>
  153. #include <stdlib.h>
  154. #include "types/wlr_xdg_shell.h"
  155. diff --git a/types/xdg_shell/wlr_xdg_shell.c b/types/xdg_shell/wlr_xdg_shell.c
  156. index 0480d5f354..c93fe7c3fb 100644
  157. --- a/types/xdg_shell/wlr_xdg_shell.c
  158. +++ b/types/xdg_shell/wlr_xdg_shell.c
  159. @@ -1,3 +1,4 @@
  160. +#define _POSIX_C_SOURCE 199309L
  161. #include <assert.h>
  162. #include <stdlib.h>
  163. #include "types/wlr_xdg_shell.h"
  164. diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c
  165. index edf562abcd..c1dfbfba7e 100644
  166. --- a/types/xdg_shell/wlr_xdg_surface.c
  167. +++ b/types/xdg_shell/wlr_xdg_surface.c
  168. @@ -1,3 +1,4 @@
  169. +#define _POSIX_C_SOURCE 199309L
  170. #include <assert.h>
  171. #include <stdlib.h>
  172. #include <string.h>