aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2024-02-06 11:54:29 +0100
committerPaul Cercueil <paul@crapouillou.net>2024-02-12 17:41:45 +0100
commit220df2aa0f8025ffe99287c3f5ea0e05436e3d08 (patch)
tree8cc87e0de47744d314c8914daa38945a9992f7c7
parent9e426e70e68cc292f55dbd2c496bcfd6bea32caf (diff)
Add more POSIX compliance macros to fix uClibc support
- Add POSIX 1993.09 compliance macro in source files that use "struct timespec"; - Add POSIX 2001.12 compliance macro in source files that use "struct sigaction" and the SA_SIGINFO macro, or the fchmod() function; - Add POSIX 2008.09 compliance macro in source files that use the getline() function. These compliance macros are enough for wlroots to compile with the git-master version of uClibc-ng. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
-rw-r--r--backend/wayland/output.c1
-rw-r--r--render/gles2/pixel_format.c1
-rw-r--r--render/gles2/texture.c1
-rw-r--r--types/data_device/wlr_data_device.c1
-rw-r--r--types/data_device/wlr_drag.c1
-rw-r--r--types/scene/drag_icon.c1
-rw-r--r--types/scene/layer_shell_v1.c1
-rw-r--r--types/scene/xdg_shell.c1
-rw-r--r--types/wlr_cursor_shape_v1.c1
-rw-r--r--types/wlr_export_dmabuf_v1.c1
-rw-r--r--types/wlr_idle_notify_v1.c1
-rw-r--r--types/wlr_keyboard.c1
-rw-r--r--types/wlr_keyboard_shortcuts_inhibit_v1.c1
-rw-r--r--types/wlr_pointer_constraints_v1.c1
-rw-r--r--types/wlr_primary_selection.c1
-rw-r--r--types/wlr_relative_pointer_v1.c1
-rw-r--r--types/wlr_screencopy_v1.c1
-rw-r--r--types/wlr_shm.c3
-rw-r--r--types/wlr_transient_seat_v1.c1
-rw-r--r--types/wlr_virtual_pointer_v1.c1
-rw-r--r--types/wlr_xdg_decoration_v1.c1
-rw-r--r--types/xdg_shell/wlr_xdg_popup.c1
-rw-r--r--types/xdg_shell/wlr_xdg_positioner.c1
-rw-r--r--types/xdg_shell/wlr_xdg_shell.c1
-rw-r--r--types/xdg_shell/wlr_xdg_surface.c1
-rw-r--r--xcursor/xcursor.c1
26 files changed, 28 insertions, 0 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 2d3e3269..b8760793 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c
index 5cdf8c99..fdf091f1 100644
--- a/render/gles2/pixel_format.c
+++ b/render/gles2/pixel_format.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <drm_fourcc.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index d66e9c16..d326da9d 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <drm_fourcc.h>
#include <GLES2/gl2.h>
diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
index 3b5b8a66..d482a0a2 100644
--- a/types/data_device/wlr_data_device.c
+++ b/types/data_device/wlr_data_device.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
index 42691116..fdbf1b8c 100644
--- a/types/data_device/wlr_drag.c
+++ b/types/data_device/wlr_drag.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/scene/drag_icon.c b/types/scene/drag_icon.c
index b508487e..7b4fa55b 100644
--- a/types/scene/drag_icon.c
+++ b/types/scene/drag_icon.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <stdlib.h>
#include "wlr/types/wlr_compositor.h"
#include <wlr/types/wlr_scene.h>
diff --git a/types/scene/layer_shell_v1.c b/types/scene/layer_shell_v1.c
index 67fdda28..710b709e 100644
--- a/types/scene/layer_shell_v1.c
+++ b/types/scene/layer_shell_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <stdlib.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_layer_shell_v1.h>
diff --git a/types/scene/xdg_shell.c b/types/scene/xdg_shell.c
index 9e3ffb05..7ebef33e 100644
--- a/types/scene/xdg_shell.c
+++ b/types/scene/xdg_shell.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <stdlib.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_xdg_shell.h>
diff --git a/types/wlr_cursor_shape_v1.c b/types/wlr_cursor_shape_v1.c
index d9f26f92..f83fdcde 100644
--- a/types/wlr_cursor_shape_v1.c
+++ b/types/wlr_cursor_shape_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_cursor_shape_v1.h>
diff --git a/types/wlr_export_dmabuf_v1.c b/types/wlr_export_dmabuf_v1.c
index 69245e37..d2fc574c 100644
--- a/types/wlr_export_dmabuf_v1.c
+++ b/types/wlr_export_dmabuf_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/types/wlr_idle_notify_v1.c b/types/wlr_idle_notify_v1.c
index 6283dc6a..9997631b 100644
--- a/types/wlr_idle_notify_v1.c
+++ b/types/wlr_idle_notify_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_idle_notify_v1.h>
diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c
index 98978ee1..7baad3b2 100644
--- a/types/wlr_keyboard.c
+++ b/types/wlr_keyboard.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_keyboard_shortcuts_inhibit_v1.c b/types/wlr_keyboard_shortcuts_inhibit_v1.c
index 0e435561..f6e17424 100644
--- a/types/wlr_keyboard_shortcuts_inhibit_v1.c
+++ b/types/wlr_keyboard_shortcuts_inhibit_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_compositor.h>
diff --git a/types/wlr_pointer_constraints_v1.c b/types/wlr_pointer_constraints_v1.c
index f3c8fb74..cea59b18 100644
--- a/types/wlr_pointer_constraints_v1.c
+++ b/types/wlr_pointer_constraints_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <limits.h>
#include <pixman.h>
diff --git a/types/wlr_primary_selection.c b/types/wlr_primary_selection.c
index e3212d6f..d4687b81 100644
--- a/types/wlr_primary_selection.c
+++ b/types/wlr_primary_selection.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_primary_selection.h>
diff --git a/types/wlr_relative_pointer_v1.c b/types/wlr_relative_pointer_v1.c
index 94fb1555..6ac846e1 100644
--- a/types/wlr_relative_pointer_v1.c
+++ b/types/wlr_relative_pointer_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
index 34f6c5b6..40e9577b 100644
--- a/types/wlr_screencopy_v1.c
+++ b/types/wlr_screencopy_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <drm_fourcc.h>
diff --git a/types/wlr_shm.c b/types/wlr_shm.c
index ac41e87e..4704df7a 100644
--- a/types/wlr_shm.c
+++ b/types/wlr_shm.c
@@ -1,3 +1,6 @@
+#if !defined(__FreeBSD__)
+#define _POSIX_C_SOURCE 200112L
+#endif
#define _DEFAULT_SOURCE // for MAP_ANONYMOUS
#include <assert.h>
#include <drm_fourcc.h>
diff --git a/types/wlr_transient_seat_v1.c b/types/wlr_transient_seat_v1.c
index 379ce0a3..92b18e84 100644
--- a/types/wlr_transient_seat_v1.c
+++ b/types/wlr_transient_seat_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wayland-util.h>
diff --git a/types/wlr_virtual_pointer_v1.c b/types/wlr_virtual_pointer_v1.c
index 6fcd0e94..8e34b6c4 100644
--- a/types/wlr_virtual_pointer_v1.c
+++ b/types/wlr_virtual_pointer_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/interfaces/wlr_pointer.h>
diff --git a/types/wlr_xdg_decoration_v1.c b/types/wlr_xdg_decoration_v1.c
index d16ac7c5..d32b15dc 100644
--- a/types/wlr_xdg_decoration_v1.c
+++ b/types/wlr_xdg_decoration_v1.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index 97e6c8e2..ffd58a61 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/xdg_shell/wlr_xdg_positioner.c b/types/xdg_shell/wlr_xdg_positioner.c
index 6a991bba..dae879bb 100644
--- a/types/xdg_shell/wlr_xdg_positioner.c
+++ b/types/xdg_shell/wlr_xdg_positioner.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/util/edges.h>
diff --git a/types/xdg_shell/wlr_xdg_shell.c b/types/xdg_shell/wlr_xdg_shell.c
index 3baea04e..d6784d1b 100644
--- a/types/xdg_shell/wlr_xdg_shell.c
+++ b/types/xdg_shell/wlr_xdg_shell.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include "types/wlr_xdg_shell.h"
diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c
index 029ab81a..1e14c07e 100644
--- a/types/xdg_shell/wlr_xdg_surface.c
+++ b/types/xdg_shell/wlr_xdg_surface.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c
index 7e1f310f..17ad758b 100644
--- a/xcursor/xcursor.c
+++ b/xcursor/xcursor.c
@@ -23,6 +23,7 @@
* SOFTWARE.
*/
+#define _POSIX_C_SOURCE 200809L
#define _DEFAULT_SOURCE
#include <stdbool.h>
#include <stdio.h>