Commit b0990aa8 authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Matthias Clasen
Browse files

wayland: Build with G_DISABLE_ASSERT

parent a871a1bd
......@@ -848,7 +848,12 @@ gdk_wayland_device_pad_get_n_groups (GdkDevicePad *pad)
data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat),
GDK_DEVICE (pad));
#ifdef G_DISABLE_ASSERT
if (data == NULL)
return 0;
#else
g_assert (data != NULL);
#endif
return g_list_length (data->mode_groups);
}
......@@ -863,7 +868,12 @@ gdk_wayland_device_pad_get_group_n_modes (GdkDevicePad *pad,
data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat),
GDK_DEVICE (pad));
#ifdef G_DISABLE_ASSERT
if (data == NULL)
return 0;
#else
g_assert (data != NULL);
#endif
group = g_list_nth_data (data->mode_groups, n_group);
if (!group)
......@@ -909,7 +919,12 @@ gdk_wayland_device_pad_get_feature_group (GdkDevicePad *pad,
data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat),
GDK_DEVICE (pad));
#ifdef G_DISABLE_ASSERT
if (data == NULL)
return -1;
#else
g_assert (data != NULL);
#endif
for (l = data->mode_groups, i = 0; l; l = l->next, i++)
{
......@@ -4236,7 +4251,14 @@ tablet_pad_handle_button (void *data,
wp_tablet_pad, button, state));
group = tablet_pad_lookup_button_group (pad, button);
#ifdef G_DISABLE_ASSERT
if (group == NULL)
return;
#else
g_assert (group != NULL);
#endif
n_group = g_list_index (pad->mode_groups, group);
event = gdk_pad_event_new_button (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED
......
......@@ -58,6 +58,19 @@
#include "gdk/gdk-private.h"
/* Keep g_assert() defined even if we disable it globally,
* as we use it in many places as a handy mechanism to check
* for non-NULL
*/
#ifdef G_DISABLE_ASSERT
# undef g_assert
# define g_assert(expr) G_STMT_START { \
if G_LIKELY (expr) ; else \
g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
#expr); \
} G_STMT_END
#endif
/**
* GdkWaylandDisplay:
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment