Skip to content

Commit

Permalink
UnGNUify the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevault committed Mar 11, 2017
1 parent 74d4f1b commit 9aed9d9
Show file tree
Hide file tree
Showing 84 changed files with 123 additions and 33 deletions.
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
add_definitions(
-D_GNU_SOURCE
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
Expand Down Expand Up @@ -70,14 +67,6 @@ find_package(PAM)

find_package(LibInput REQUIRED)

find_package(Backtrace)
if(Backtrace_FOUND)
include_directories("${Backtrace_INCLUDE_DIRS}")
add_definitions(-DSWAY_Backtrace_FOUND=1)
set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}")
set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}")
endif()

if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
find_package(EpollShim REQUIRED)
endif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
Expand Down
7 changes: 0 additions & 7 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,3 @@ add_library(sway-common STATIC
)

target_link_libraries(sway-common m)

if(Backtrace_FOUND)
set_target_properties(sway-common
PROPERTIES
COMPILE_FLAGS "-include ${Backtrace_HEADER}"
)
endif()
3 changes: 2 additions & 1 deletion common/ipc-client.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdint.h>
#define _POSIX_C_SOURCE 2
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
Expand Down
1 change: 1 addition & 0 deletions common/log.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _POSIX_C_SOURCE 1
#include <errno.h>
#include <libgen.h>
#include <signal.h>
Expand Down
1 change: 1 addition & 0 deletions common/stringop.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions common/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <wlc/wlc.h>
#include <xkbcommon/xkbcommon-names.h>
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-names.h>
#include <wlc/wlc.h>
Expand Down
1 change: 1 addition & 0 deletions sway/commands/assign.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <stdio.h>
#include <string.h>
#include "sway/commands.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/config.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/binding_mode_indicator.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
2 changes: 2 additions & 0 deletions sway/commands/bar/hidden_state.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/ipc-server.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/id.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include "sway/commands.h"
#include "log.h"
Expand Down
2 changes: 2 additions & 0 deletions sway/commands/bar/mode.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/ipc-server.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/output.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include "sway/commands.h"
#include "list.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/pango_markup.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/position.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/separator_symbol.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include "sway/commands.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/strip_workspace_numbers.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/tray_padding.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/workspace_buttons.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/bar/wrap_scroll.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/border.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/container.h"
#include "sway/focus.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/debuglog.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/exec_always.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
Expand Down
1 change: 1 addition & 0 deletions sway/commands/floating.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/container.h"
#include "sway/ipc-server.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/floating_mod.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input_state.h"
#include "list.h"
Expand Down
2 changes: 2 additions & 0 deletions sway/commands/floating_scroll.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"
#include "stringop.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/focus.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include <wlc/wlc.h>
#include "sway/commands.h"
#include "sway/container.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/focus_follows_mouse.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_focus_follows_mouse(int argc, char **argv) {
Expand Down
1 change: 1 addition & 0 deletions sway/commands/font.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include "sway/border.h"
#include "sway/commands.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/for_window.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _XOPEN_SOURCE 500
#include <string.h>
#include "sway/commands.h"
#include "sway/criteria.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/force_focus_wrapping.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_force_focus_wrapping(int argc, char **argv) {
Expand Down
1 change: 1 addition & 0 deletions sway/commands/gaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/container.h"
#include "sway/focus.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/hide_edge_borders.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_hide_edge_borders(int argc, char **argv) {
Expand Down
1 change: 1 addition & 0 deletions sway/commands/input.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/accel_profile.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/click_method.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/drag_lock.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/dwt.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/events.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/left_handed.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/middle_emulation.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/natural_scroll.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/scroll_method.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/input/tap.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/input.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/layout.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/container.h"
#include "sway/layout.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/log_colors.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "log.h"

Expand Down
2 changes: 2 additions & 0 deletions sway/commands/mode.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#define _XOPEN_SOURCE 500
#include <stdbool.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/ipc-server.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/mouse_warping.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_mouse_warping(int argc, char **argv) {
Expand Down
1 change: 1 addition & 0 deletions sway/commands/move.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include <wlc/wlc.h>
#include "sway/commands.h"
#include "sway/container.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/new_float.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <errno.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/container.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/new_window.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <errno.h>
#include <string.h>
#include <strings.h>
#include "sway/commands.h"
#include "sway/container.h"

Expand Down
1 change: 1 addition & 0 deletions sway/commands/orientation.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_orientation(int argc, char **argv) {
Expand Down
2 changes: 2 additions & 0 deletions sway/commands/output.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#define _XOPEN_SOURCE 500
#include <ctype.h>
#include <libgen.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <wordexp.h>
#include "sway/commands.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <wlc/wlc.h>
#include "sway/commands.h"
#include "sway/layout.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/scratchpad.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include <wlc/wlc.h>
#include "sway/commands.h"
#include "sway/container.h"
Expand Down
1 change: 1 addition & 0 deletions sway/commands/seamless_mouse.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include "sway/commands.h"

struct cmd_results *cmd_seamless_mouse(int argc, char **argv) {
Expand Down
Loading

1 comment on commit 9aed9d9

@robotanarchy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! :)

Please sign in to comment.