Implement __rb_same_type
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Nov 2011 18:19:24 +0000 (13:19 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Nov 2011 18:19:24 +0000 (13:19 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/core.h
libringbuffer/backend_internal.h
libringbuffer/frontend_types.h

index 0c483e8847e4fe0be3cd4e6c3b69997586d32a0c..2b962d5fe4d3f9a2237fcc36a94d1f2c2ac707f0 100644 (file)
@@ -107,12 +107,4 @@ static inline unsigned int hweight32(unsigned int w)
        return (res + (res >> 16)) & 0x000000FF;
 }
 
-#ifndef inline_memcpy
-#define inline_memcpy memcpy
-#endif
-
-#ifndef __same_type
-#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
-#endif
-
 #endif /* UST_CORE_H */
index dbe34fc1e4419dbee03d2993c115d140582c2f78..c4fb7604aa18bf9b3018551257dd3be61285b022 100644 (file)
@@ -416,6 +416,10 @@ int update_read_sb_index(const struct lttng_ust_lib_ring_buffer_config *config,
        return 0;
 }
 
+#ifndef inline_memcpy
+#define inline_memcpy(dest, src, n)    memcpy(dest, src, n)
+#endif
+
 /*
  * Use the architecture-specific memcpy implementation for constant-sized
  * inputs, but rely on an inline memcpy for length statically unknown.
index 9c733d170fe7fadfb8fa8fe8a958bc7ef4de6d43..bccd5f85bcd8d1ecaea6964af1b802ced3139074 100644 (file)
@@ -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);                              \
This page took 0.026088 seconds and 4 git commands to generate.