X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Ffrontend_types.h;h=32462f6b5725cb5ab1883566ee7bc397e43ad528;hb=44c72f10aa3cace72ffe40a0f9bb7aadb9c82dc8;hp=0a0488459d8e5fe7fc062a96915acaeaf959a231;hpb=b728d87e617189fe9898a9492a559ecf949d2348;p=lttng-ust.git diff --git a/libringbuffer/frontend_types.h b/libringbuffer/frontend_types.h index 0a048845..32462f6b 100644 --- a/libringbuffer/frontend_types.h +++ b/libringbuffer/frontend_types.h @@ -21,12 +21,11 @@ #include #include -#include "lttng/core.h" - -#include #include +#include #include "backend_types.h" #include "shm_internal.h" +#include "vatomic.h" /* * A switch is done during tracing or as a final flush after tracing (so it @@ -118,6 +117,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 @@ -128,11 +131,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); \