From b5da914920a0cd405e03568b6337452960b52408 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 21 May 2019 23:23:30 +0100 Subject: [PATCH] Mark xcb_generate_id deprecated in compton x_new_id is preferred since it checks for error. Signed-off-by: Yuxuan Shui --- src/compiler.h | 6 ++++++ src/x.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/compiler.h b/src/compiler.h index 153853b..8d8722e 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -66,6 +66,12 @@ # define attr_ret_nonnull #endif +#if __has_attribute(deprecated) +# define attr_deprecated __attribute__((deprecated)) +#else +# define attr_deprecated +#endif + #if __has_attribute(malloc) # define attr_malloc __attribute__((malloc)) #else diff --git a/src/x.h b/src/x.h index 7440a3e..5c08e39 100644 --- a/src/x.h +++ b/src/x.h @@ -244,3 +244,5 @@ struct xvisual_info x_get_visual_info(xcb_connection_t *c, xcb_visualid_t visual xcb_visualid_t x_get_visual_for_standard(xcb_connection_t *c, xcb_pict_standard_t std); xcb_screen_t *x_screen_of_display(xcb_connection_t *c, int screen); + +uint32_t attr_deprecated xcb_generate_id(xcb_connection_t *c);