aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/backend.c1
-rw-r--r--backend/drm/atomic.c1
-rw-r--r--backend/drm/drm.c1
-rw-r--r--backend/drm/libliftoff.c1
-rw-r--r--backend/drm/properties.c1
-rw-r--r--backend/drm/util.c1
-rw-r--r--backend/libinput/events.c1
-rw-r--r--backend/libinput/tablet_pad.c1
-rw-r--r--backend/libinput/tablet_tool.c1
-rw-r--r--backend/multi/backend.c1
-rw-r--r--backend/session/session.c1
-rw-r--r--backend/wayland/backend.c1
-rw-r--r--backend/wayland/output.c1
-rw-r--r--backend/wayland/pointer.c1
-rw-r--r--backend/wayland/seat.c1
-rw-r--r--backend/wayland/tablet_v2.c1
-rw-r--r--backend/x11/backend.c1
-rw-r--r--backend/x11/output.c1
-rw-r--r--examples/cairo-buffer.c1
-rw-r--r--examples/embedded.c1
-rw-r--r--examples/fullscreen-shell.c1
-rw-r--r--examples/output-layers.c1
-rw-r--r--examples/output-layout.c1
-rw-r--r--examples/pointer.c1
-rw-r--r--examples/rotation.c1
-rw-r--r--examples/scene-graph.c1
-rw-r--r--examples/simple.c1
-rw-r--r--examples/tablet.c3
-rw-r--r--examples/touch.c1
-rw-r--r--meson.build1
-rw-r--r--render/allocator/allocator.c1
-rw-r--r--render/allocator/drm_dumb.c1
-rw-r--r--render/allocator/gbm.c1
-rw-r--r--render/dmabuf.c1
-rw-r--r--render/egl.c1
-rw-r--r--render/gles2/pass.c1
-rw-r--r--render/gles2/pixel_format.c1
-rw-r--r--render/gles2/renderer.c1
-rw-r--r--render/gles2/texture.c1
-rw-r--r--render/vulkan/renderer.c1
-rw-r--r--render/vulkan/texture.c1
-rw-r--r--render/vulkan/vulkan.c4
-rw-r--r--render/wlr_renderer.c1
-rw-r--r--tinywl/tinywl.c1
-rw-r--r--types/data_device/wlr_data_device.c1
-rw-r--r--types/data_device/wlr_data_offer.c3
-rw-r--r--types/data_device/wlr_data_source.c1
-rw-r--r--types/data_device/wlr_drag.c1
-rw-r--r--types/output/output.c1
-rw-r--r--types/scene/drag_icon.c1
-rw-r--r--types/scene/layer_shell_v1.c1
-rw-r--r--types/scene/wlr_scene.c1
-rw-r--r--types/scene/xdg_shell.c1
-rw-r--r--types/seat/wlr_seat.c1
-rw-r--r--types/seat/wlr_seat_keyboard.c1
-rw-r--r--types/seat/wlr_seat_pointer.c1
-rw-r--r--types/seat/wlr_seat_touch.c1
-rw-r--r--types/tablet_v2/wlr_tablet_v2.c4
-rw-r--r--types/tablet_v2/wlr_tablet_v2_pad.c4
-rw-r--r--types/tablet_v2/wlr_tablet_v2_tablet.c4
-rw-r--r--types/tablet_v2/wlr_tablet_v2_tool.c4
-rw-r--r--types/wlr_cursor.c1
-rw-r--r--types/wlr_cursor_shape_v1.c1
-rw-r--r--types/wlr_data_control_v1.c1
-rw-r--r--types/wlr_drm.c1
-rw-r--r--types/wlr_export_dmabuf_v1.c1
-rw-r--r--types/wlr_ext_foreign_toplevel_list_v1.c1
-rw-r--r--types/wlr_foreign_toplevel_management_v1.c1
-rw-r--r--types/wlr_fractional_scale_v1.c1
-rw-r--r--types/wlr_gamma_control_v1.c1
-rw-r--r--types/wlr_idle_notify_v1.c1
-rw-r--r--types/wlr_input_device.c1
-rw-r--r--types/wlr_input_method_v2.c3
-rw-r--r--types/wlr_keyboard.c1
-rw-r--r--types/wlr_keyboard_group.c1
-rw-r--r--types/wlr_keyboard_shortcuts_inhibit_v1.c1
-rw-r--r--types/wlr_layer_shell_v1.c1
-rw-r--r--types/wlr_linux_dmabuf_v1.c1
-rw-r--r--types/wlr_pointer_constraints_v1.c1
-rw-r--r--types/wlr_pointer_gestures_v1.c4
-rw-r--r--types/wlr_presentation_time.c1
-rw-r--r--types/wlr_primary_selection.c1
-rw-r--r--types/wlr_primary_selection_v1.c1
-rw-r--r--types/wlr_relative_pointer_v1.c1
-rw-r--r--types/wlr_screencopy_v1.c1
-rw-r--r--types/wlr_security_context_v1.c1
-rw-r--r--types/wlr_session_lock_v1.c1
-rw-r--r--types/wlr_shm.c4
-rw-r--r--types/wlr_tearing_control_v1.c1
-rw-r--r--types/wlr_text_input_v3.c3
-rw-r--r--types/wlr_transient_seat_v1.c1
-rw-r--r--types/wlr_virtual_keyboard_v1.c1
-rw-r--r--types/wlr_virtual_pointer_v1.c1
-rw-r--r--types/wlr_xcursor_manager.c1
-rw-r--r--types/wlr_xdg_activation_v1.c1
-rw-r--r--types/wlr_xdg_decoration_v1.c1
-rw-r--r--types/wlr_xdg_foreign_v1.c1
-rw-r--r--types/wlr_xdg_foreign_v2.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--types/xdg_shell/wlr_xdg_toplevel.c1
-rw-r--r--util/log.c1
-rw-r--r--util/shm.c1
-rw-r--r--util/time.c1
-rw-r--r--util/token.c1
-rw-r--r--xcursor/wlr_xcursor.c1
-rw-r--r--xcursor/xcursor.c4
-rw-r--r--xwayland/selection/incoming.c1
-rw-r--r--xwayland/selection/selection.c1
-rw-r--r--xwayland/server.c1
-rw-r--r--xwayland/sockets.c3
-rw-r--r--xwayland/xwayland.c1
-rw-r--r--xwayland/xwm.c3
115 files changed, 12 insertions, 139 deletions
diff --git a/backend/backend.c b/backend/backend.c
index 0021dbae..de2acfe3 100644
--- a/backend/backend.c
+++ b/backend/backend.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index 6588bdc0..bbbd064e 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <drm_fourcc.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 42080603..d92b41d3 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <drm_mode.h>
diff --git a/backend/drm/libliftoff.c b/backend/drm/libliftoff.c
index 534e5ef2..334a660c 100644
--- a/backend/drm/libliftoff.c
+++ b/backend/drm/libliftoff.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <fcntl.h>
#include <libliftoff.h>
#include <sys/stat.h>
diff --git a/backend/drm/properties.c b/backend/drm/properties.c
index 4f495177..ecd0d910 100644
--- a/backend/drm/properties.c
+++ b/backend/drm/properties.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 0e7f3f8b..a14e5e1e 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <drm_mode.h>
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index 4726e32b..dcc65137 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <libinput.h>
#include <stdlib.h>
diff --git a/backend/libinput/tablet_pad.c b/backend/libinput/tablet_pad.c
index e5327528..3cf7f142 100644
--- a/backend/libinput/tablet_pad.c
+++ b/backend/libinput/tablet_pad.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <string.h>
#include <libinput.h>
diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c
index 1c85d08b..f3266c28 100644
--- a/backend/libinput/tablet_tool.c
+++ b/backend/libinput/tablet_tool.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <string.h>
#include <assert.h>
#include <libinput.h>
diff --git a/backend/multi/backend.c b/backend/multi/backend.c
index dc2668bb..740e1d6f 100644
--- a/backend/multi/backend.c
+++ b/backend/multi/backend.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
diff --git a/backend/session/session.c b/backend/session/session.c
index 4ae67c7c..5fb20c22 100644
--- a/backend/session/session.c
+++ b/backend/session/session.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <libudev.h>
#include <stdarg.h>
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index 7629ff71..9522de40 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <limits.h>
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index b8760793..2d3e3269 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/backend/wayland/pointer.c b/backend/wayland/pointer.c
index 0cad9720..f795d12d 100644
--- a/backend/wayland/pointer.c
+++ b/backend/wayland/pointer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c
index d88a370f..0de149bb 100644
--- a/backend/wayland/seat.c
+++ b/backend/wayland/seat.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdint.h>
diff --git a/backend/wayland/tablet_v2.c b/backend/wayland/tablet_v2.c
index a3604b51..6d793881 100644
--- a/backend/wayland/tablet_v2.c
+++ b/backend/wayland/tablet_v2.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <math.h>
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 3c963a28..ec15a9c9 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <limits.h>
diff --git a/backend/x11/output.c b/backend/x11/output.c
index 0c4966c6..51a8459d 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
diff --git a/examples/cairo-buffer.c b/examples/cairo-buffer.c
index d4619878..7de4a053 100644
--- a/examples/cairo-buffer.c
+++ b/examples/cairo-buffer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <stdbool.h>
#include <stdlib.h>
diff --git a/examples/embedded.c b/examples/embedded.c
index 7b33d839..ff8b8851 100644
--- a/examples/embedded.c
+++ b/examples/embedded.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c
index 46923d9f..c12f126e 100644
--- a/examples/fullscreen-shell.c
+++ b/examples/fullscreen-shell.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
diff --git a/examples/output-layers.c b/examples/output-layers.c
index 1b34d584..cd05d9f0 100644
--- a/examples/output-layers.c
+++ b/examples/output-layers.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
diff --git a/examples/output-layout.c b/examples/output-layout.c
index 4400685c..3a3eeb24 100644
--- a/examples/output-layout.c
+++ b/examples/output-layout.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <drm_fourcc.h>
#include <limits.h>
#include <math.h>
diff --git a/examples/pointer.c b/examples/pointer.c
index 7d1f4e4b..bb249b42 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <math.h>
#include <stdio.h>
diff --git a/examples/rotation.c b/examples/rotation.c
index 7ee8dc78..351973f6 100644
--- a/examples/rotation.c
+++ b/examples/rotation.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <drm_fourcc.h>
#include <getopt.h>
#include <math.h>
diff --git a/examples/scene-graph.c b/examples/scene-graph.c
index cbc09136..fb530c06 100644
--- a/examples/scene-graph.c
+++ b/examples/scene-graph.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <getopt.h>
#include <stdbool.h>
diff --git a/examples/simple.c b/examples/simple.c
index 1a018829..81ed2e0e 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/examples/tablet.c b/examples/tablet.c
index c97cafe4..7e9116a8 100644
--- a/examples/tablet.c
+++ b/examples/tablet.c
@@ -1,4 +1,5 @@
-#define _XOPEN_SOURCE 600
+#undef _POSIX_C_SOURCE
+#define _XOPEN_SOURCE 600 // for M_PI
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/examples/touch.c b/examples/touch.c
index f0aca30d..e1bd7381 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <drm_fourcc.h>
#include <math.h>
#include <stdint.h>
diff --git a/meson.build b/meson.build
index 95803a22..c3ea7fc6 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ little_endian = target_machine.endian() == 'little'
big_endian = target_machine.endian() == 'big'
add_project_arguments([
+ '-D_POSIX_C_SOURCE=200809L',
'-DWLR_USE_UNSTABLE',
'-DWLR_LITTLE_ENDIAN=@0@'.format(little_endian.to_int()),
'-DWLR_BIG_ENDIAN=@0@'.format(big_endian.to_int()),
diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c
index e0620a1b..639b52be 100644
--- a/render/allocator/allocator.c
+++ b/render/allocator/allocator.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
diff --git a/render/allocator/drm_dumb.c b/render/allocator/drm_dumb.c
index 6de44f40..eb4ce99f 100644
--- a/render/allocator/drm_dumb.c
+++ b/render/allocator/drm_dumb.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
diff --git a/render/allocator/gbm.c b/render/allocator/gbm.c
index 25ddbbae..baa0fb6e 100644
--- a/render/allocator/gbm.c
+++ b/render/allocator/gbm.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <fcntl.h>
diff --git a/render/dmabuf.c b/render/dmabuf.c
index b0b8ef41..7096dbc0 100644
--- a/render/dmabuf.c
+++ b/render/dmabuf.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <fcntl.h>
#include <unistd.h>
#include <wlr/render/dmabuf.h>
diff --git a/render/egl.c b/render/egl.c
index 162634be..ac991295 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <fcntl.h>
diff --git a/render/gles2/pass.c b/render/gles2/pass.c
index 4c9f9e28..9177b0a1 100644
--- a/render/gles2/pass.c
+++ b/render/gles2/pass.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <stdlib.h>
#include <assert.h>
#include <pixman.h>
diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c
index fdf091f1..5cdf8c99 100644
--- a/render/gles2/pixel_format.c
+++ b/render/gles2/pixel_format.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <drm_fourcc.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index a71423c0..e095f469 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <drm_fourcc.h>
#include <GLES2/gl2.h>
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index d326da9d..d66e9c16 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <drm_fourcc.h>
#include <GLES2/gl2.h>
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c
index 05486a0f..d433f495 100644
--- a/render/vulkan/renderer.c
+++ b/render/vulkan/renderer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <math.h>
diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c
index a3fede04..51372b5f 100644
--- a/render/vulkan/texture.c
+++ b/render/vulkan/texture.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <fcntl.h>
diff --git a/render/vulkan/vulkan.c b/render/vulkan/vulkan.c
index 8e9d9288..54bfa77a 100644
--- a/render/vulkan/vulkan.c
+++ b/render/vulkan/vulkan.c
@@ -1,5 +1,5 @@
-#if !defined(__FreeBSD__)
-#define _POSIX_C_SOURCE 200809L
+#if defined(__FreeBSD__)
+#undef _POSIX_C_SOURCE
#endif
#include <assert.h>
#include <fcntl.h>
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index 0ddb364e..513fecbd 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdbool.h>
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c
index 0342ec54..ec8f3c03 100644
--- a/tinywl/tinywl.c
+++ b/tinywl/tinywl.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <getopt.h>
#include <stdbool.h>
diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
index d482a0a2..3b5b8a66 100644
--- a/types/data_device/wlr_data_device.c
+++ b/types/data_device/wlr_data_device.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/data_device/wlr_data_offer.c b/types/data_device/wlr_data_offer.c
index b1bff337..4bb9d0c2 100644
--- a/types/data_device/wlr_data_offer.c
+++ b/types/data_device/wlr_data_offer.c
@@ -1,4 +1,5 @@
-#define _XOPEN_SOURCE 700
+#undef _POSIX_C_SOURCE
+#define _XOPEN_SOURCE 700 // for ffs()
#include <assert.h>
#include <stdlib.h>
#include <strings.h>
diff --git a/types/data_device/wlr_data_source.c b/types/data_device/wlr_data_source.c
index 5fcc617b..15fb9929 100644
--- a/types/data_device/wlr_data_source.c
+++ b/types/data_device/wlr_data_source.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#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 fdbf1b8c..42691116 100644
--- a/types/data_device/wlr_drag.c
+++ b/types/data_device/wlr_drag.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/output/output.c b/types/output/output.c
index 511bc0ec..4376da99 100644
--- a/types/output/output.c
+++ b/types/output/output.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <backend/backend.h>
#include <drm_fourcc.h>
diff --git a/types/scene/drag_icon.c b/types/scene/drag_icon.c
index 7b4fa55b..b508487e 100644
--- a/types/scene/drag_icon.c
+++ b/types/scene/drag_icon.c
@@ -1,4 +1,3 @@
-#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 710b709e..67fdda28 100644
--- a/types/scene/layer_shell_v1.c
+++ b/types/scene/layer_shell_v1.c
@@ -1,4 +1,3 @@
-#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/wlr_scene.c b/types/scene/wlr_scene.c
index 7c507179..7e5b3136 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/scene/xdg_shell.c b/types/scene/xdg_shell.c
index 7ebef33e..9e3ffb05 100644
--- a/types/scene/xdg_shell.c
+++ b/types/scene/xdg_shell.c
@@ -1,4 +1,3 @@
-#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/seat/wlr_seat.c b/types/seat/wlr_seat.c
index 73e30786..2e8e4a84 100644
--- a/types/seat/wlr_seat.c
+++ b/types/seat/wlr_seat.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/seat/wlr_seat_keyboard.c b/types/seat/wlr_seat_keyboard.c
index 0193d58d..dcbc0a3d 100644
--- a/types/seat/wlr_seat_keyboard.c
+++ b/types/seat/wlr_seat_keyboard.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c
index 5e4401f9..1d57fff2 100644
--- a/types/seat/wlr_seat_pointer.c
+++ b/types/seat/wlr_seat_pointer.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/seat/wlr_seat_touch.c b/types/seat/wlr_seat_touch.c
index 3843b5ee..5a140006 100644
--- a/types/seat/wlr_seat_touch.c
+++ b/types/seat/wlr_seat_touch.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/tablet_v2/wlr_tablet_v2.c b/types/tablet_v2/wlr_tablet_v2.c
index d93e92d6..3182effe 100644
--- a/types/tablet_v2/wlr_tablet_v2.c
+++ b/types/tablet_v2/wlr_tablet_v2.c
@@ -1,7 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
-
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/tablet_v2/wlr_tablet_v2_pad.c b/types/tablet_v2/wlr_tablet_v2_pad.c
index bf8fb704..76208cac 100644
--- a/types/tablet_v2/wlr_tablet_v2_pad.c
+++ b/types/tablet_v2/wlr_tablet_v2_pad.c
@@ -1,7 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
-
#include <assert.h>
#include <stdlib.h>
#include <types/wlr_tablet_v2.h>
diff --git a/types/tablet_v2/wlr_tablet_v2_tablet.c b/types/tablet_v2/wlr_tablet_v2_tablet.c
index af374b6f..184570f6 100644
--- a/types/tablet_v2/wlr_tablet_v2_tablet.c
+++ b/types/tablet_v2/wlr_tablet_v2_tablet.c
@@ -1,7 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
-
#include <assert.h>
#include <stdlib.h>
#include <types/wlr_tablet_v2.h>
diff --git a/types/tablet_v2/wlr_tablet_v2_tool.c b/types/tablet_v2/wlr_tablet_v2_tool.c
index a5a45485..9700e904 100644
--- a/types/tablet_v2/wlr_tablet_v2_tool.c
+++ b/types/tablet_v2/wlr_tablet_v2_tool.c
@@ -1,7 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
-
#include <assert.h>
#include <stdlib.h>
#include <types/wlr_tablet_v2.h>
diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c
index a1d6b042..16c3a08a 100644
--- a/types/wlr_cursor.c
+++ b/types/wlr_cursor.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <limits.h>
diff --git a/types/wlr_cursor_shape_v1.c b/types/wlr_cursor_shape_v1.c
index f83fdcde..d9f26f92 100644
--- a/types/wlr_cursor_shape_v1.c
+++ b/types/wlr_cursor_shape_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_cursor_shape_v1.h>
diff --git a/types/wlr_data_control_v1.c b/types/wlr_data_control_v1.c
index e4f3223b..88f23ae4 100644
--- a/types/wlr_data_control_v1.c
+++ b/types/wlr_data_control_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_drm.c b/types/wlr_drm.c
index a75f3042..9cbc4cec 100644
--- a/types/wlr_drm.c
+++ b/types/wlr_drm.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <stdlib.h>
diff --git a/types/wlr_export_dmabuf_v1.c b/types/wlr_export_dmabuf_v1.c
index d2fc574c..69245e37 100644
--- a/types/wlr_export_dmabuf_v1.c
+++ b/types/wlr_export_dmabuf_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/types/wlr_ext_foreign_toplevel_list_v1.c b/types/wlr_ext_foreign_toplevel_list_v1.c
index 94713183..6c059e64 100644
--- a/types/wlr_ext_foreign_toplevel_list_v1.c
+++ b/types/wlr_ext_foreign_toplevel_list_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <string.h>
diff --git a/types/wlr_foreign_toplevel_management_v1.c b/types/wlr_foreign_toplevel_management_v1.c
index 80b1fc5a..23935d48 100644
--- a/types/wlr_foreign_toplevel_management_v1.c
+++ b/types/wlr_foreign_toplevel_management_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <string.h>
diff --git a/types/wlr_fractional_scale_v1.c b/types/wlr_fractional_scale_v1.c
index d9852758..60797469 100644
--- a/types/wlr_fractional_scale_v1.c
+++ b/types/wlr_fractional_scale_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_compositor.h>
diff --git a/types/wlr_gamma_control_v1.c b/types/wlr_gamma_control_v1.c
index c24da9a2..3780bda8 100644
--- a/types/wlr_gamma_control_v1.c
+++ b/types/wlr_gamma_control_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
diff --git a/types/wlr_idle_notify_v1.c b/types/wlr_idle_notify_v1.c
index 9997631b..6283dc6a 100644
--- a/types/wlr_idle_notify_v1.c
+++ b/types/wlr_idle_notify_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_idle_notify_v1.h>
diff --git a/types/wlr_input_device.c b/types/wlr_input_device.c
index 7de98b75..ede2e04d 100644
--- a/types/wlr_input_device.c
+++ b/types/wlr_input_device.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_input_method_v2.c b/types/wlr_input_method_v2.c
index 1bad7b14..e50b02a0 100644
--- a/types/wlr_input_method_v2.c
+++ b/types/wlr_input_method_v2.c
@@ -1,6 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
#include <assert.h>
#include <string.h>
#include <sys/mman.h>
diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c
index 7baad3b2..98978ee1 100644
--- a/types/wlr_keyboard.c
+++ b/types/wlr_keyboard.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_keyboard_group.c b/types/wlr_keyboard_group.c
index b4c7e552..ef557a95 100644
--- a/types/wlr_keyboard_group.c
+++ b/types/wlr_keyboard_group.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/types/wlr_keyboard_shortcuts_inhibit_v1.c b/types/wlr_keyboard_shortcuts_inhibit_v1.c
index f6e17424..0e435561 100644
--- a/types/wlr_keyboard_shortcuts_inhibit_v1.c
+++ b/types/wlr_keyboard_shortcuts_inhibit_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_compositor.h>
diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
index 17674780..a59f1104 100644
--- a/types/wlr_layer_shell_v1.c
+++ b/types/wlr_layer_shell_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_linux_dmabuf_v1.c b/types/wlr_linux_dmabuf_v1.c
index 41642822..13e82760 100644
--- a/types/wlr_linux_dmabuf_v1.c
+++ b/types/wlr_linux_dmabuf_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <drm_fourcc.h>
#include <fcntl.h>
diff --git a/types/wlr_pointer_constraints_v1.c b/types/wlr_pointer_constraints_v1.c
index cea59b18..f3c8fb74 100644
--- a/types/wlr_pointer_constraints_v1.c
+++ b/types/wlr_pointer_constraints_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <limits.h>
#include <pixman.h>
diff --git a/types/wlr_pointer_gestures_v1.c b/types/wlr_pointer_gestures_v1.c
index 0628bb50..0763f3ac 100644
--- a/types/wlr_pointer_gestures_v1.c
+++ b/types/wlr_pointer_gestures_v1.c
@@ -1,7 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
-
#include <assert.h>
#include <stdlib.h>
#include <wayland-server-core.h>
diff --git a/types/wlr_presentation_time.c b/types/wlr_presentation_time.c
index 49887173..35b960d0 100644
--- a/types/wlr_presentation_time.c
+++ b/types/wlr_presentation_time.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_primary_selection.c b/types/wlr_primary_selection.c
index d4687b81..e3212d6f 100644
--- a/types/wlr_primary_selection.c
+++ b/types/wlr_primary_selection.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_primary_selection.h>
diff --git a/types/wlr_primary_selection_v1.c b/types/wlr_primary_selection_v1.c
index af232ef7..0a5f0fbd 100644
--- a/types/wlr_primary_selection_v1.c
+++ b/types/wlr_primary_selection_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
diff --git a/types/wlr_relative_pointer_v1.c b/types/wlr_relative_pointer_v1.c
index 6ac846e1..94fb1555 100644
--- a/types/wlr_relative_pointer_v1.c
+++ b/types/wlr_relative_pointer_v1.c
@@ -1,4 +1,3 @@
-#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 40e9577b..34f6c5b6 100644
--- a/types/wlr_screencopy_v1.c
+++ b/types/wlr_screencopy_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <drm_fourcc.h>
diff --git a/types/wlr_security_context_v1.c b/types/wlr_security_context_v1.c
index ce7def5c..a43af9e0 100644
--- a/types/wlr_security_context_v1.c
+++ b/types/wlr_security_context_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_session_lock_v1.c b/types/wlr_session_lock_v1.c
index 4c094da9..73874f85 100644
--- a/types/wlr_session_lock_v1.c
+++ b/types/wlr_session_lock_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <wayland-server-core.h>
diff --git a/types/wlr_shm.c b/types/wlr_shm.c
index 4704df7a..6160c4b0 100644
--- a/types/wlr_shm.c
+++ b/types/wlr_shm.c
@@ -1,6 +1,4 @@
-#if !defined(__FreeBSD__)
-#define _POSIX_C_SOURCE 200112L
-#endif
+#undef _POSIX_C_SOURCE
#define _DEFAULT_SOURCE // for MAP_ANONYMOUS
#include <assert.h>
#include <drm_fourcc.h>
diff --git a/types/wlr_tearing_control_v1.c b/types/wlr_tearing_control_v1.c
index a1898b4d..cd7cd5a5 100644
--- a/types/wlr_tearing_control_v1.c
+++ b/types/wlr_tearing_control_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c
index 11944f26..936eca1a 100644
--- a/types/wlr_text_input_v3.c
+++ b/types/wlr_text_input_v3.c
@@ -1,6 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
#include <assert.h>
#include <stdlib.h>
#include <stddef.h>
diff --git a/types/wlr_transient_seat_v1.c b/types/wlr_transient_seat_v1.c
index 92b18e84..379ce0a3 100644
--- a/types/wlr_transient_seat_v1.c
+++ b/types/wlr_transient_seat_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wayland-util.h>
diff --git a/types/wlr_virtual_keyboard_v1.c b/types/wlr_virtual_keyboard_v1.c
index 639156fa..8a6d107d 100644
--- a/types/wlr_virtual_keyboard_v1.c
+++ b/types/wlr_virtual_keyboard_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/types/wlr_virtual_pointer_v1.c b/types/wlr_virtual_pointer_v1.c
index 8e34b6c4..6fcd0e94 100644
--- a/types/wlr_virtual_pointer_v1.c
+++ b/types/wlr_virtual_pointer_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <wlr/interfaces/wlr_pointer.h>
diff --git a/types/wlr_xcursor_manager.c b/types/wlr_xcursor_manager.c
index 96679d58..b45dcd7b 100644
--- a/types/wlr_xcursor_manager.c
+++ b/types/wlr_xcursor_manager.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#include <string.h>
#include <wlr/types/wlr_xcursor_manager.h>
diff --git a/types/wlr_xdg_activation_v1.c b/types/wlr_xdg_activation_v1.c
index cd382713..8e0fb061 100644
--- a/types/wlr_xdg_activation_v1.c
+++ b/types/wlr_xdg_activation_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/wlr_xdg_decoration_v1.c b/types/wlr_xdg_decoration_v1.c
index d32b15dc..d16ac7c5 100644
--- a/types/wlr_xdg_decoration_v1.c
+++ b/types/wlr_xdg_decoration_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
diff --git a/types/wlr_xdg_foreign_v1.c b/types/wlr_xdg_foreign_v1.c
index d4bcc6a7..12cd4fc0 100644
--- a/types/wlr_xdg_foreign_v1.c
+++ b/types/wlr_xdg_foreign_v1.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <string.h>
diff --git a/types/wlr_xdg_foreign_v2.c b/types/wlr_xdg_foreign_v2.c
index f600d533..4cfbe77b 100644
--- a/types/wlr_xdg_foreign_v2.c
+++ b/types/wlr_xdg_foreign_v2.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <string.h>
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index ffd58a61..97e6c8e2 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -1,4 +1,3 @@
-#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 dae879bb..6a991bba 100644
--- a/types/xdg_shell/wlr_xdg_positioner.c
+++ b/types/xdg_shell/wlr_xdg_positioner.c
@@ -1,4 +1,3 @@
-#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 d6784d1b..3baea04e 100644
--- a/types/xdg_shell/wlr_xdg_shell.c
+++ b/types/xdg_shell/wlr_xdg_shell.c
@@ -1,4 +1,3 @@
-#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 1e14c07e..029ab81a 100644
--- a/types/xdg_shell/wlr_xdg_surface.c
+++ b/types/xdg_shell/wlr_xdg_surface.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 199309L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c
index 7f67aeaf..488e454c 100644
--- a/types/xdg_shell/wlr_xdg_toplevel.c
+++ b/types/xdg_shell/wlr_xdg_toplevel.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/util/log.c b/util/log.c
index 9996ab8a..a329b43b 100644
--- a/util/log.c
+++ b/util/log.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/util/shm.c b/util/shm.c
index 6fddebbb..5eb87bb8 100644
--- a/util/shm.c
+++ b/util/shm.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200112L
#include <errno.h>
#include <fcntl.h>
#include <string.h>
diff --git a/util/time.c b/util/time.c
index 78faac56..bc4a1063 100644
--- a/util/time.c
+++ b/util/time.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <stdint.h>
#include <time.h>
diff --git a/util/token.c b/util/token.c
index 09702e55..2d58d169 100644
--- a/util/token.c
+++ b/util/token.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include "util/token.h"
#include "wlr/util/log.h"
diff --git a/xcursor/wlr_xcursor.c b/xcursor/wlr_xcursor.c
index 620b6c78..c57d8175 100644
--- a/xcursor/wlr_xcursor.c
+++ b/xcursor/wlr_xcursor.c
@@ -23,7 +23,6 @@
* SOFTWARE.
*/
-#define _POSIX_C_SOURCE 200809L
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c
index 17ad758b..66346709 100644
--- a/xcursor/xcursor.c
+++ b/xcursor/xcursor.c
@@ -23,8 +23,8 @@
* SOFTWARE.
*/
-#define _POSIX_C_SOURCE 200809L
-#define _DEFAULT_SOURCE
+#undef _POSIX_C_SOURCE
+#define _DEFAULT_SOURCE // for d_type in struct dirent
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c
index c2e1e712..4a0b450c 100644
--- a/xwayland/selection/incoming.c
+++ b/xwayland/selection/incoming.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
diff --git a/xwayland/selection/selection.c b/xwayland/selection/selection.c
index 0079df2f..4d1e366e 100644
--- a/xwayland/selection/selection.c
+++ b/xwayland/selection/selection.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
diff --git a/xwayland/server.c b/xwayland/server.c
index 6dd42246..4f92879d 100644
--- a/xwayland/server.c
+++ b/xwayland/server.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/xwayland/sockets.c b/xwayland/sockets.c
index 873fde8d..9e287f36 100644
--- a/xwayland/sockets.c
+++ b/xwayland/sockets.c
@@ -1,4 +1,5 @@
-#define _XOPEN_SOURCE 700
+#undef _POSIX_C_SOURCE
+#define _XOPEN_SOURCE 700 // for S_ISVTX
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c
index 0ffc1fef..c4ca9ae4 100644
--- a/xwayland/xwayland.c
+++ b/xwayland/xwayland.c
@@ -1,4 +1,3 @@
-#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 9a6cf771..c75f2be7 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -1,6 +1,3 @@
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200809L
-#endif
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>