[ltt-dev] [PATCH v2 5/6] api: reimplement useful parts in compiler.h

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Aug 16 06:35:25 EDT 2011


* Paolo Bonzini (pbonzini at redhat.com) wrote:
[...] 
>  /*
>   * Machine parameters.
> diff --git a/urcu/compiler.h b/urcu/compiler.h
> index 54904cc..9875e62 100644
> --- a/urcu/compiler.h
> +++ b/urcu/compiler.h
> @@ -61,4 +61,11 @@
>  		(type *)((char *)__ptr - offsetof(type, member));	\
>  	})
>  
> +#ifndef __always_inline
> +#define __always_inline inline
> +#endif
> +
> +#define CAA_BUILD_BUG_ON_ZERO(cond) (sizeof(struct { int:-!!(cond); }))
> +#define CAA_BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))

Sorry for late reply, but see my earlier email (removing need for
__always_inline). For using a negative bitfield within a structure, I
think we could go with that trick, given that it is very much trivial.

Thanks,

Mathieu

> +
>  #endif /* _URCU_COMPILER_H */
> -- 
> 1.7.6
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list