build: unify naming for HAVE_* defines

We sometimes used HAS_, sometimes polluted the LIBINPUT_ namespace,
etc.
This commit is contained in:
Simon Ser 2022-11-25 18:15:31 +01:00 committed by Alexander Orzechowski
parent a4a40618ad
commit 86fc2199f8
11 changed files with 22 additions and 22 deletions

View file

@ -174,12 +174,12 @@ void handle_libinput_event(struct wlr_libinput_backend *backend,
handle_pointer_button(event, &dev->pointer);
break;
case LIBINPUT_EVENT_POINTER_AXIS:
#if !LIBINPUT_HAS_SCROLL_VALUE120
#if !HAVE_LIBINPUT_SCROLL_VALUE120
/* This event must be ignored in favour of the SCROLL_* events */
handle_pointer_axis(event, &dev->pointer);
#endif
break;
#if LIBINPUT_HAS_SCROLL_VALUE120
#if HAVE_LIBINPUT_SCROLL_VALUE120
case LIBINPUT_EVENT_POINTER_SCROLL_WHEEL:
handle_pointer_axis_value120(event, &dev->pointer,
WLR_AXIS_SOURCE_WHEEL);
@ -250,7 +250,7 @@ void handle_libinput_event(struct wlr_libinput_backend *backend,
case LIBINPUT_EVENT_GESTURE_PINCH_END:
handle_pointer_pinch_end(event, &dev->pointer);
break;
#if LIBINPUT_HAS_HOLD_GESTURES
#if HAVE_LIBINPUT_HOLD_GESTURES
case LIBINPUT_EVENT_GESTURE_HOLD_BEGIN:
handle_pointer_hold_begin(event, &dev->pointer);
break;

View file

@ -29,5 +29,5 @@ features += { 'libinput-backend': true }
wlr_deps += libinput
# libinput hold gestures and high resolution scroll are available since 1.19.0
internal_config.set10('LIBINPUT_HAS_HOLD_GESTURES', libinput.version().version_compare('>=1.19.0'))
internal_config.set10('LIBINPUT_HAS_SCROLL_VALUE120', libinput.version().version_compare('>=1.19.0'))
internal_config.set10('HAVE_LIBINPUT_HOLD_GESTURES', libinput.version().version_compare('>=1.19.0'))
internal_config.set10('HAVE_LIBINPUT_SCROLL_VALUE120', libinput.version().version_compare('>=1.19.0'))

View file

@ -124,7 +124,7 @@ void handle_pointer_axis(struct libinput_event *event,
wl_signal_emit_mutable(&pointer->events.frame, pointer);
}
#if LIBINPUT_HAS_SCROLL_VALUE120
#if HAVE_LIBINPUT_SCROLL_VALUE120
void handle_pointer_axis_value120(struct libinput_event *event,
struct wlr_pointer *pointer, enum wlr_axis_source source) {
struct libinput_event_pointer *pevent =

View file

@ -198,7 +198,7 @@ static void backend_destroy(struct wlr_backend *backend) {
wlr_drm_format_set_finish(&x11->dri3_formats);
wlr_drm_format_set_finish(&x11->shm_formats);
#if HAS_XCB_ERRORS
#if HAVE_XCB_ERRORS
xcb_errors_context_free(x11->errors_context);
#endif
@ -629,7 +629,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
shm_format->format, DRM_FORMAT_MOD_INVALID);
}
#if HAS_XCB_ERRORS
#if HAVE_XCB_ERRORS
if (xcb_errors_context_new(x11->xcb, &x11->errors_context) != 0) {
wlr_log(WLR_ERROR, "Failed to create error context");
return false;
@ -673,7 +673,7 @@ error_x11:
}
static void handle_x11_error(struct wlr_x11_backend *x11, xcb_value_error_t *ev) {
#if HAS_XCB_ERRORS
#if HAVE_XCB_ERRORS
const char *major_name = xcb_errors_get_name_for_major_code(
x11->errors_context, ev->major_opcode);
if (!major_name) {
@ -711,7 +711,7 @@ log_raw:
static void handle_x11_unknown_event(struct wlr_x11_backend *x11,
xcb_generic_event_t *ev) {
#if HAS_XCB_ERRORS
#if HAVE_XCB_ERRORS
const char *extension;
const char *event_name = xcb_errors_get_name_for_xcb_event(
x11->errors_context, ev, &extension);