aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-11-12 10:12:46 +0100
committeremersion <contact@emersion.fr>2018-11-12 10:12:46 +0100
commit51bfdd620e70c41e1a9fb4ce7831eddfb1bf893b (patch)
treef32586aa88e18d9bfec7cbcbeb5c682b2f35fb4a /xwayland
parent3181c4bec06d2fe51da052c0a08c8287725ec900 (diff)
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.
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/meson.build4
-rw-r--r--xwayland/xwm.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/xwayland/meson.build b/xwayland/meson.build
index 0bd88924..e5f9b9be 100644
--- a/xwayland/meson.build
+++ b/xwayland/meson.build
@@ -23,7 +23,7 @@ foreach lib : xwayland_optional
dep = dependency(lib, required: get_option(lib))
if dep.found()
xwayland_libs += dep
- conf_data.set('WLR_HAS_' + lib.underscorify().to_upper(), true)
+ conf_data.set10('WLR_HAS_' + lib.underscorify().to_upper(), true)
endif
endforeach
@@ -48,4 +48,4 @@ lib_wlr_xwayland = static_library(
)
wlr_parts += lib_wlr_xwayland
-conf_data.set('WLR_HAS_XWAYLAND', true)
+conf_data.set10('WLR_HAS_XWAYLAND', true)
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index c61c3ced..91fa7e3d 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -502,7 +502,7 @@ static void read_surface_protocols(struct wlr_xwm *xwm,
wlr_log(WLR_DEBUG, "WM_PROTOCOLS (%zu)", atoms_len);
}
-#ifdef WLR_HAS_XCB_ICCCM
+#if WLR_HAS_XCB_ICCCM
static void read_surface_hints(struct wlr_xwm *xwm,
struct wlr_xwayland_surface *xsurface,
xcb_get_property_reply_t *reply) {
@@ -540,7 +540,7 @@ static void read_surface_hints(struct wlr_xwm *xwm,
}
#endif
-#ifdef WLR_HAS_XCB_ICCCM
+#if WLR_HAS_XCB_ICCCM
static void read_surface_normal_hints(struct wlr_xwm *xwm,
struct wlr_xwayland_surface *xsurface,
xcb_get_property_reply_t *reply) {
@@ -1195,7 +1195,7 @@ static void xwm_handle_focus_in(struct wlr_xwm *xwm,
}
static void xwm_handle_xcb_error(struct wlr_xwm *xwm, xcb_value_error_t *ev) {
-#ifdef WLR_HAS_XCB_ERRORS
+#if WLR_HAS_XCB_ERRORS
const char *major_name =
xcb_errors_get_name_for_major_code(xwm->errors_context,
ev->major_opcode);
@@ -1233,7 +1233,7 @@ log_raw:
}
static void xwm_handle_unhandled_event(struct wlr_xwm *xwm, xcb_generic_event_t *ev) {
-#ifdef WLR_HAS_XCB_ERRORS
+#if WLR_HAS_XCB_ERRORS
const char *extension;
const char *event_name =
xcb_errors_get_name_for_xcb_event(xwm->errors_context,
@@ -1418,7 +1418,7 @@ void xwm_destroy(struct wlr_xwm *xwm) {
if (xwm->event_source) {
wl_event_source_remove(xwm->event_source);
}
-#ifdef WLR_HAS_XCB_ERRORS
+#if WLR_HAS_XCB_ERRORS
if (xwm->errors_context) {
xcb_errors_context_free(xwm->errors_context);
}
@@ -1659,7 +1659,7 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland) {
return NULL;
}
-#ifdef WLR_HAS_XCB_ERRORS
+#if WLR_HAS_XCB_ERRORS
if (xcb_errors_context_new(xwm->xcb_conn, &xwm->errors_context)) {
wlr_log(WLR_ERROR, "Could not allocate error context");
xwm_destroy(xwm);