X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fmacros.h;h=36ec04b745738d59090f2de5825ba230060b9fa4;hb=825395e249eb9c58b453ce8b14612f29574917ad;hp=13f51d9d1cb4d6fe7c3191e6a59e94b9a57643bd;hpb=65121c2141d0df9a1d6fc759904cea4bbc016331;p=lttng-tools.git diff --git a/src/common/macros.h b/src/common/macros.h index 13f51d9d1..36ec04b74 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -96,6 +96,13 @@ void *zmalloc(size_t len) #define member_sizeof(type, field) sizeof(((type *) 0)->field) +/* + * Get an aligned pointer to a value. This is meant + * as a helper to pass an aligned pointer to a member in a packed structure + * to a function. + */ +#define ALIGNED_CONST_PTR(value) (((const typeof(value) []) { value })) + /* * lttng_strncpy returns 0 on success, or nonzero on failure. * It checks that the @src string fits into @dst_len before performing