From 51bfdd620e70c41e1a9fb4ce7831eddfb1bf893b Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 12 Nov 2018 10:12:46 +0100 Subject: Use #if instead of #ifdef for wlroots config data This prevents some annoying issues when e.g. not including wlr/config.h or making a typo in the guard name. --- backend/x11/backend.c | 4 ++-- backend/x11/input_device.c | 4 ++-- backend/x11/meson.build | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'backend/x11') diff --git a/backend/x11/backend.c b/backend/x11/backend.c index c0a11fbb..cd7986a0 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -17,7 +17,7 @@ #include #include #include -#ifdef WLR_HAS_XCB_XKB +#if WLR_HAS_XCB_XKB #include #endif #include "backend/x11.h" @@ -148,7 +148,7 @@ static bool backend_start(struct wlr_backend *backend) { 0, 0); xcb_free_pixmap(x11->xcb_conn, pix); -#ifdef WLR_HAS_XCB_XKB +#if WLR_HAS_XCB_XKB const xcb_query_extension_reply_t *reply = xcb_get_extension_data(x11->xcb_conn, &xcb_xkb_id); if (reply != NULL && reply->present) { diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c index a16da1c9..5b108ffb 100644 --- a/backend/x11/input_device.c +++ b/backend/x11/input_device.c @@ -10,7 +10,7 @@ #elif __FreeBSD__ #include #endif -#ifdef WLR_HAS_XCB_XKB +#if WLR_HAS_XCB_XKB #include #endif #include "backend/x11.h" @@ -124,7 +124,7 @@ void handle_x11_input_event(struct wlr_x11_backend *x11, return; } default: -#ifdef WLR_HAS_XCB_XKB +#if WLR_HAS_XCB_XKB if (x11->xkb_supported && event->response_type == x11->xkb_base_event) { xcb_xkb_state_notify_event_t *ev = (xcb_xkb_state_notify_event_t *)event; diff --git a/backend/x11/meson.build b/backend/x11/meson.build index 1164df1e..fa51e3d7 100644 --- a/backend/x11/meson.build +++ b/backend/x11/meson.build @@ -20,7 +20,7 @@ foreach lib : x11_optional dep = dependency(lib, required: get_option(lib)) if dep.found() x11_libs += dep - conf_data.set('WLR_HAS_' + lib.underscorify().to_upper(), true) + conf_data.set10('WLR_HAS_' + lib.underscorify().to_upper(), true) endif endforeach @@ -41,4 +41,4 @@ lib_wlr_backend_x11 = static_library( ) backend_parts += lib_wlr_backend_x11 -conf_data.set('WLR_HAS_X11_BACKEND', true) +conf_data.set10('WLR_HAS_X11_BACKEND', true) -- cgit v1.2.3