X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libringbuffer%2Ffrontend_types.h;h=bccd5f85bcd8d1ecaea6964af1b802ced3139074;hb=0d4aa2df26584c00cdb504ff2b3d4a5fdd8f5f08;hp=9c733d170fe7fadfb8fa8fe8a958bc7ef4de6d43;hpb=2b2d6ff75efc17aa74ea9b0a7f8c756d812804bb;p=lttng-ust.git diff --git a/libringbuffer/frontend_types.h b/libringbuffer/frontend_types.h index 9c733d17..bccd5f85 100644 --- a/libringbuffer/frontend_types.h +++ b/libringbuffer/frontend_types.h @@ -119,6 +119,10 @@ void *channel_get_private(struct channel *chan) return ((char *) chan) + chan->priv_data_offset; } +#ifndef __rb_same_type +#define __rb_same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) +#endif + /* * Issue warnings and disable channels upon internal error. * Can receive struct lttng_ust_lib_ring_buffer or struct lttng_ust_lib_ring_buffer_backend @@ -129,11 +133,11 @@ void *channel_get_private(struct channel *chan) struct channel *__chan; \ int _____ret = caa_unlikely(cond); \ if (_____ret) { \ - if (__same_type(*(c), struct channel_backend)) \ + if (__rb_same_type(*(c), struct channel_backend)) \ __chan = caa_container_of((void *) (c), \ struct channel, \ backend); \ - else if (__same_type(*(c), struct channel)) \ + else if (__rb_same_type(*(c), struct channel)) \ __chan = (void *) (c); \ else \ BUG_ON(1); \