]> git.lizzy.rs Git - bspwm.git/commitdiff
Port BSPWM to gcc10
authorEmanuele Torre <torreemanuele6@gmail.com>
Wed, 27 May 2020 01:18:10 +0000 (03:18 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 26 Jul 2020 12:36:52 +0000 (14:36 +0200)
GCC10 enables -fno-common by default.
This patch allows building BSPWM with -fno-common enabled.

Fixes #1119.

src/bspwm.c
src/bspwm.h
src/events.c
src/events.h
src/ewmh.c
src/ewmh.h
src/pointer.c
src/pointer.h
src/settings.c
src/settings.h

index 981bbd640d4d2ec40b48c4a2a91695f0c38bd5c1..d70a35af9b023d5f2f7df93f77ecbc883974913d 100644 (file)
 #include "query.h"
 #include "bspwm.h"
 
+xcb_connection_t *dpy;
+int default_screen, screen_width, screen_height;
+uint32_t clients_count;
+xcb_screen_t *screen;
+xcb_window_t root;
+char config_path[MAXLEN];
+
+monitor_t *mon;
+monitor_t *mon_head;
+monitor_t *mon_tail;
+monitor_t *pri_mon;
+history_t *history_head;
+history_t *history_tail;
+history_t *history_needle;
+rule_t *rule_head;
+rule_t *rule_tail;
+stacking_list_t *stack_head;
+stacking_list_t *stack_tail;
+subscriber_list_t *subscribe_head;
+subscriber_list_t *subscribe_tail;
+pending_rule_t *pending_rule_head;
+pending_rule_t *pending_rule_tail;
+
+xcb_window_t meta_window;
+motion_recorder_t motion_recorder;
+xcb_atom_t WM_STATE;
+xcb_atom_t WM_TAKE_FOCUS;
+xcb_atom_t WM_DELETE_WINDOW;
+int exit_status;
+
+bool auto_raise;
+bool sticky_still;
+bool hide_sticky;
+bool record_history;
+bool running;
+bool restart;
+bool randr;
+
 int main(int argc, char *argv[])
 {
        fd_set descriptors;
index 35bded5de3ab7fc4ac3f67187b8d03dd4a75bcfe..139d4c305613030273931327bd534676521a25ee 100644 (file)
 #define MOTION_RECORDER_I   "motion_recorder"
 #define MOTION_RECORDER_IC  MOTION_RECORDER_I "\0" BSPWM_CLASS_NAME
 
-xcb_connection_t *dpy;
-int default_screen, screen_width, screen_height;
-uint32_t clients_count;
-xcb_screen_t *screen;
-xcb_window_t root;
-char config_path[MAXLEN];
-
-monitor_t *mon;
-monitor_t *mon_head;
-monitor_t *mon_tail;
-monitor_t *pri_mon;
-history_t *history_head;
-history_t *history_tail;
-history_t *history_needle;
-rule_t *rule_head;
-rule_t *rule_tail;
-stacking_list_t *stack_head;
-stacking_list_t *stack_tail;
-subscriber_list_t *subscribe_head;
-subscriber_list_t *subscribe_tail;
-pending_rule_t *pending_rule_head;
-pending_rule_t *pending_rule_tail;
-
-xcb_window_t meta_window;
-struct {
+typedef struct {
        xcb_window_t id;
        uint16_t sequence;
        bool enabled;
-} motion_recorder;
-xcb_atom_t WM_STATE;
-xcb_atom_t WM_TAKE_FOCUS;
-xcb_atom_t WM_DELETE_WINDOW;
-int exit_status;
+} motion_recorder_t;
+
+extern xcb_connection_t *dpy;
+extern int default_screen, screen_width, screen_height;
+extern uint32_t clients_count;
+extern xcb_screen_t *screen;
+extern xcb_window_t root;
+extern char config_path[MAXLEN];
+
+extern monitor_t *mon;
+extern monitor_t *mon_head;
+extern monitor_t *mon_tail;
+extern monitor_t *pri_mon;
+extern history_t *history_head;
+extern history_t *history_tail;
+extern history_t *history_needle;
+extern rule_t *rule_head;
+extern rule_t *rule_tail;
+extern stacking_list_t *stack_head;
+extern stacking_list_t *stack_tail;
+extern subscriber_list_t *subscribe_head;
+extern subscriber_list_t *subscribe_tail;
+extern pending_rule_t *pending_rule_head;
+extern pending_rule_t *pending_rule_tail;
+
+extern xcb_window_t meta_window;
+extern motion_recorder_t motion_recorder;
+extern xcb_atom_t WM_STATE;
+extern xcb_atom_t WM_TAKE_FOCUS;
+extern xcb_atom_t WM_DELETE_WINDOW;
+extern int exit_status;
 
-bool auto_raise;
-bool sticky_still;
-bool hide_sticky;
-bool record_history;
-bool running;
-bool restart;
-bool randr;
+extern bool auto_raise;
+extern bool sticky_still;
+extern bool hide_sticky;
+extern bool record_history;
+extern bool running;
+extern bool restart;
+extern bool randr;
 
 void init(void);
 void setup(void);
index 483d5c8935dc3a69b3fba0e1796d6049277cc3f1..3b82c96fff235b763c163b76d1a0aa5337705937 100644 (file)
@@ -35,6 +35,8 @@
 #include "rule.h"
 #include "events.h"
 
+uint8_t randr_base;
+
 void handle_event(xcb_generic_event_t *evt)
 {
        uint8_t resp_type = XCB_EVENT_RESPONSE_TYPE(evt);
index d450965e64d617388d769c69bce7359b06ffa9d0..f144dcc2aa1d67ba5d5bde15cbdb80a2cece1c88 100644 (file)
@@ -30,7 +30,7 @@
 
 #define ERROR_CODE_BAD_WINDOW  3
 
-uint8_t randr_base;
+extern uint8_t randr_base;
 static const xcb_button_index_t BUTTONS[] = {XCB_BUTTON_INDEX_1, XCB_BUTTON_INDEX_2, XCB_BUTTON_INDEX_3};
 
 void handle_event(xcb_generic_event_t *evt);
index 7fb0c38dcdf71d312b402fb5060dcacd2fa3cfa4..52f7e53a91d185e8b32c16d20e2a76929052c221 100644 (file)
@@ -31,6 +31,8 @@
 #include "tree.h"
 #include "ewmh.h"
 
+xcb_ewmh_connection_t *ewmh;
+
 void ewmh_init(void)
 {
        ewmh = calloc(1, sizeof(xcb_ewmh_connection_t));
index 5bf3e18bbbc9a98fe5c91b3a6da54150c4c7c859..3b50e359f690e13f6b30e595d6971942822b04e6 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <xcb/xcb_ewmh.h>
 
-xcb_ewmh_connection_t *ewmh;
+extern xcb_ewmh_connection_t *ewmh;
 
 void ewmh_init(void);
 void ewmh_update_active_window(void);
index 1bc6a6bbe9227bbd9857fa272111649270991318..5eb93c34be4acace513c0cb5bc4118b534097c75 100644 (file)
 #include "window.h"
 #include "pointer.h"
 
+uint16_t num_lock;
+uint16_t caps_lock;
+uint16_t scroll_lock;
+
+bool grabbing;
+node_t *grabbed_node;
+
 void pointer_init(void)
 {
        num_lock = modfield_from_keysym(XK_Num_Lock);
index 4930e41acebe43736380c3d369e88a8a2badeb44..ba88cfde971f216b068af2802ae5f75b051da9b4 100644 (file)
 #define XK_Caps_Lock    0xffe5
 #define XK_Scroll_Lock  0xff14
 
-uint16_t num_lock;
-uint16_t caps_lock;
-uint16_t scroll_lock;
+extern uint16_t num_lock;
+extern uint16_t caps_lock;
+extern uint16_t scroll_lock;
 
-bool grabbing;
-node_t *grabbed_node;
+extern bool grabbing;
+extern node_t *grabbed_node;
 
 void pointer_init(void);
 void window_grab_buttons(xcb_window_t win);
index 7997c371a60c42740a44d2736bedb5b690dc100d..df2dbe235d9bee97c8afe4ebccf5d4956982f7e6 100644 (file)
 
 extern char **environ;
 
+char external_rules_command[MAXLEN];
+char status_prefix[MAXLEN];
+
+char normal_border_color[MAXLEN];
+char active_border_color[MAXLEN];
+char focused_border_color[MAXLEN];
+char presel_feedback_color[MAXLEN];
+
+padding_t padding;
+padding_t monocle_padding;
+int window_gap;
+unsigned int border_width;
+double split_ratio;
+child_polarity_t initial_polarity;
+automatic_scheme_t automatic_scheme;
+bool removal_adjustment;
+tightness_t directional_focus_tightness;
+
+uint16_t pointer_modifier;
+uint32_t pointer_motion_interval;
+pointer_action_t pointer_actions[3];
+int8_t mapping_events_count;
+
+bool presel_feedback;
+bool borderless_monocle;
+bool gapless_monocle;
+bool single_monocle;
+
+bool focus_follows_pointer;
+bool pointer_follows_focus;
+bool pointer_follows_monitor;
+int8_t click_to_focus;
+bool swallow_first_click;
+bool ignore_ewmh_focus;
+bool ignore_ewmh_struts;
+state_transition_t ignore_ewmh_fullscreen;
+
+bool center_pseudo_tiled;
+bool honor_size_hints;
+
+bool remove_disabled_monitors;
+bool remove_unplugged_monitors;
+bool merge_overlapping_monitors;
+
 void run_config(void)
 {
        if (fork() == 0) {
index c205e50bc3ccaf68f09c94e7403e94f7706e4794..021bf6d06afd8f7a749779db0d42c88fad15f2ee 100644 (file)
 #define REMOVE_UNPLUGGED_MONITORS   false
 #define MERGE_OVERLAPPING_MONITORS  false
 
-char external_rules_command[MAXLEN];
-char status_prefix[MAXLEN];
-
-char normal_border_color[MAXLEN];
-char active_border_color[MAXLEN];
-char focused_border_color[MAXLEN];
-char presel_feedback_color[MAXLEN];
-
-padding_t padding;
-padding_t monocle_padding;
-int window_gap;
-unsigned int border_width;
-double split_ratio;
-child_polarity_t initial_polarity;
-automatic_scheme_t automatic_scheme;
-bool removal_adjustment;
-tightness_t directional_focus_tightness;
-
-uint16_t pointer_modifier;
-uint32_t pointer_motion_interval;
-pointer_action_t pointer_actions[3];
-int8_t mapping_events_count;
-
-bool presel_feedback;
-bool borderless_monocle;
-bool gapless_monocle;
-bool single_monocle;
-
-bool focus_follows_pointer;
-bool pointer_follows_focus;
-bool pointer_follows_monitor;
-int8_t click_to_focus;
-bool swallow_first_click;
-bool ignore_ewmh_focus;
-bool ignore_ewmh_struts;
-state_transition_t ignore_ewmh_fullscreen;
-
-bool center_pseudo_tiled;
-bool honor_size_hints;
-
-bool remove_disabled_monitors;
-bool remove_unplugged_monitors;
-bool merge_overlapping_monitors;
+extern char external_rules_command[MAXLEN];
+extern char status_prefix[MAXLEN];
+
+extern char normal_border_color[MAXLEN];
+extern char active_border_color[MAXLEN];
+extern char focused_border_color[MAXLEN];
+extern char presel_feedback_color[MAXLEN];
+
+extern padding_t padding;
+extern padding_t monocle_padding;
+extern int window_gap;
+extern unsigned int border_width;
+extern double split_ratio;
+extern child_polarity_t initial_polarity;
+extern automatic_scheme_t automatic_scheme;
+extern bool removal_adjustment;
+extern tightness_t directional_focus_tightness;
+
+extern uint16_t pointer_modifier;
+extern uint32_t pointer_motion_interval;
+extern pointer_action_t pointer_actions[3];
+extern int8_t mapping_events_count;
+
+extern bool presel_feedback;
+extern bool borderless_monocle;
+extern bool gapless_monocle;
+extern bool single_monocle;
+
+extern bool focus_follows_pointer;
+extern bool pointer_follows_focus;
+extern bool pointer_follows_monitor;
+extern int8_t click_to_focus;
+extern bool swallow_first_click;
+extern bool ignore_ewmh_focus;
+extern bool ignore_ewmh_struts;
+extern state_transition_t ignore_ewmh_fullscreen;
+
+extern bool center_pseudo_tiled;
+extern bool honor_size_hints;
+
+extern bool remove_disabled_monitors;
+extern bool remove_unplugged_monitors;
+extern bool merge_overlapping_monitors;
 
 void run_config(void);
 void load_settings(void);