sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 3a310f92ab619cf8afcb99486bc91b49c7989791
parent 827e5513e030eff40323832466e8a39f11aae4eb
Author: emersion <contact@emersion.fr>
Date:   Sun, 25 Nov 2018 12:12:48 +0100

Replace _XOPEN_SOURCE with _POSIX_C_SOURCE

And make sure we don't define both in the same source file.

Diffstat:
Mcommon/stringop.c | 2+-
Msway/commands/assign.c | 2+-
Msway/commands/bar/bindsym.c | 1-
Msway/commands/bar/hidden_state.c | 2+-
Msway/commands/bar/icon_theme.c | 1-
Msway/commands/bar/id.c | 2+-
Msway/commands/bar/mode.c | 2+-
Msway/commands/bar/output.c | 2+-
Msway/commands/bar/separator_symbol.c | 2+-
Msway/commands/bar/tray_output.c | 1-
Msway/commands/bind.c | 2+-
Msway/commands/exec_always.c | 2+-
Msway/commands/for_window.c | 1-
Msway/commands/input/xkb_layout.c | 2+-
Msway/commands/input/xkb_model.c | 2+-
Msway/commands/input/xkb_options.c | 2+-
Msway/commands/input/xkb_rules.c | 2+-
Msway/commands/input/xkb_variant.c | 2+-
Msway/commands/mode.c | 2+-
Msway/commands/move.c | 2+-
Msway/commands/no_focus.c | 1-
Msway/commands/reload.c | 2+-
Msway/commands/rename.c | 1-
Msway/commands/seat/attach.c | 2+-
Msway/commands/seat/cursor.c | 2+-
Msway/commands/set.c | 2+-
Msway/commands/workspace.c | 4++--
Msway/config.c | 3+--
Msway/config/bar.c | 1-
Msway/config/input.c | 2+-
Msway/config/output.c | 2+-
Msway/config/seat.c | 2+-
Msway/criteria.c | 2+-
Msway/input/cursor.c | 2+-
Msway/input/input-manager.c | 2+-
Msway/input/seat.c | 3+--
Msway/main.c | 3+--
Msway/security.c | 2+-
Mswaybar/bar.c | 2+-
Mswaybar/config.c | 2+-
Mswaybar/main.c | 2+-
Mswaylock/main.c | 3+--
Mswaylock/pam.c | 2+-
Mswaylock/password.c | 1-
Mswaylock/render.c | 1-
Mswaylock/shadow.c | 2+-
Mswaymsg/main.c | 2+-
Mswaynag/config.c | 4+---
Mswaynag/main.c | 3+--
Mswaynag/swaynag.c | 2+-
Mswaynag/types.c | 2+-
51 files changed, 43 insertions(+), 59 deletions(-)

diff --git a/common/stringop.c b/common/stringop.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <stdio.h> #include <string.h> diff --git a/sway/commands/assign.c b/sway/commands/assign.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdio.h> #include <string.h> #include "sway/commands.h" diff --git a/sway/commands/bar/bindsym.c b/sway/commands/bar/bindsym.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <stdlib.h> #include <string.h> #include <strings.h> diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <string.h> #include <strings.h> #include "sway/commands.h" diff --git a/sway/commands/bar/icon_theme.c b/sway/commands/bar/icon_theme.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <string.h> #include "sway/commands.h" diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <string.h> #include "sway/commands.h" #include "log.h" diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <string.h> #include <strings.h> #include "sway/commands.h" diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdbool.h> #include <string.h> #include "sway/commands.h" diff --git a/sway/commands/bar/separator_symbol.c b/sway/commands/bar/separator_symbol.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <string.h> #include "sway/commands.h" #include "log.h" diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <string.h> #include "sway/commands.h" diff --git a/sway/commands/bind.c b/sway/commands/bind.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #ifdef __linux__ #include <linux/input-event-codes.h> #elif __FreeBSD__ diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <stdint.h> #include <string.h> diff --git a/sway/commands/for_window.c b/sway/commands/for_window.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <string.h> #include "sway/commands.h" #include "sway/criteria.h" diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" diff --git a/sway/commands/mode.c b/sway/commands/mode.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdbool.h> #include <string.h> #include <strings.h> diff --git a/sway/commands/move.c b/sway/commands/move.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <ctype.h> #include <stdbool.h> #include <string.h> diff --git a/sway/commands/no_focus.c b/sway/commands/no_focus.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <string.h> #include "sway/commands.h" #include "sway/criteria.h" diff --git a/sway/commands/reload.c b/sway/commands/reload.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <string.h> #include "sway/commands.h" #include "sway/config.h" diff --git a/sway/commands/rename.c b/sway/commands/rename.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <ctype.h> #include <string.h> #include <strings.h> diff --git a/sway/commands/seat/attach.c b/sway/commands/seat/attach.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <string.h> #include <strings.h> #include "sway/input/input-manager.h" diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #ifdef __linux__ #include <linux/input-event-codes.h> #elif __FreeBSD__ diff --git a/sway/commands/set.c b/sway/commands/set.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdio.h> #include <string.h> #include <strings.h> diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <ctype.h> #include <limits.h> #include <string.h> @@ -38,7 +38,7 @@ void free_workspace_config(struct workspace_config *wsc) { } static void prevent_invalid_outer_gaps(struct workspace_config *wsc) { - if (wsc->gaps_outer.top != INT_MIN && + if (wsc->gaps_outer.top != INT_MIN && wsc->gaps_outer.top < -wsc->gaps_inner) { wsc->gaps_outer.top = -wsc->gaps_inner; } diff --git a/sway/config.c b/sway/config.c @@ -1,5 +1,4 @@ -#define _POSIX_C_SOURCE 200809L -#define _XOPEN_SOURCE 700 +#define _XOPEN_SOURCE 600 // for realpath #include <stdio.h> #include <stdbool.h> #include <stdlib.h> diff --git a/sway/config/bar.c b/sway/config/bar.c @@ -1,5 +1,4 @@ #define _POSIX_C_SOURCE 200809L -#define _XOPEN_SOURCE 700 #include <stdio.h> #include <stdbool.h> #include <stdlib.h> diff --git a/sway/config/input.c b/sway/config/input.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <limits.h> #include <float.h> diff --git a/sway/config/output.c b/sway/config/output.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <assert.h> #include <stdbool.h> #include <string.h> diff --git a/sway/config/seat.c b/sway/config/seat.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <string.h> #include "sway/config.h" diff --git a/sway/criteria.c b/sway/criteria.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <stdio.h> #include <stdbool.h> diff --git a/sway/input/cursor.c b/sway/input/cursor.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <math.h> #ifdef __linux__ #include <linux/input-event-codes.h> diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <ctype.h> #include <float.h> #include <limits.h> diff --git a/sway/input/seat.c b/sway/input/seat.c @@ -1,5 +1,4 @@ -#define _XOPEN_SOURCE 700 -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #include <assert.h> #include <errno.h> #ifdef __linux__ diff --git a/sway/main.c b/sway/main.c @@ -1,5 +1,4 @@ -#define _XOPEN_SOURCE 700 -#define _POSIX_C_SOURCE 200112L +#define _POSIX_C_SOURCE 200809L #include <getopt.h> #include <pango/pangocairo.h> #include <signal.h> diff --git a/sway/security.c b/sway/security.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 700 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <string.h> #include "sway/security.h" diff --git a/swaybar/bar.c b/swaybar/bar.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <assert.h> #include <errno.h> #include <fcntl.h> diff --git a/swaybar/config.c b/swaybar/config.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <string.h> #include <wlr/util/log.h> diff --git a/swaybar/main.c b/swaybar/main.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/swaylock/main.c b/swaylock/main.c @@ -1,5 +1,4 @@ -#define _XOPEN_SOURCE 700 -#define _POSIX_C_SOURCE 200112L +#define _POSIX_C_SOURCE 200809L #include <assert.h> #include <ctype.h> #include <errno.h> diff --git a/swaylock/pam.c b/swaylock/pam.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <pwd.h> #include <security/pam_appl.h> #include <stdbool.h> diff --git a/swaylock/password.c b/swaylock/password.c @@ -1,4 +1,3 @@ -#define _XOPEN_SOURCE 500 #include <assert.h> #include <errno.h> #include <pwd.h> diff --git a/swaylock/render.c b/swaylock/render.c @@ -1,4 +1,3 @@ -#define _POSIX_C_SOURCE 199506L #include <math.h> #include <stdlib.h> #include <wayland-client.h> diff --git a/swaylock/shadow.c b/swaylock/shadow.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE +#define _XOPEN_SOURCE // for crypt #include <pwd.h> #include <shadow.h> #include <stdbool.h> diff --git a/swaymsg/main.c b/swaymsg/main.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/swaynag/config.c b/swaynag/config.c @@ -1,5 +1,4 @@ -#define _XOPEN_SOURCE 700 -#define _POSIX_C_SOURCE 200112L +#define _POSIX_C_SOURCE 200809L #include <getopt.h> #include <stdlib.h> #include <wordexp.h> @@ -398,4 +397,3 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) { fclose(config); return 0; } - diff --git a/swaynag/main.c b/swaynag/main.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <signal.h> #include "log.h" @@ -130,4 +130,3 @@ cleanup: swaynag_destroy(&swaynag); return exit_code; } - diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <assert.h> #include <sys/stat.h> diff --git a/swaynag/types.c b/swaynag/types.c @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE 500 +#define _POSIX_C_SOURCE 200809L #include <getopt.h> #include <stdbool.h> #include <stdlib.h>