Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH] Fixes container_of macro redefinition warnings
@ 2010-08-16 14:24 David Goulet
  2010-08-16 14:34 ` Mathieu Desnoyers
  2010-08-18  4:13 ` Pierre-Marc Fournier
  0 siblings, 2 replies; 3+ messages in thread
From: David Goulet @ 2010-08-16 14:24 UTC (permalink / raw)


On urcu commit 453629a9317adef5b96c3d55e4dcd98db680997a, the
container_of macro was moved to urcu/compiler.h. Since, multiple
warnings appear about redefinition

Signed-off-by: David Goulet <david.goulet at polymtl.ca>
---
 include/ust/core.h           |    2 ++
 include/ust/kcompat/simple.h |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/ust/core.h b/include/ust/core.h
index 0172614..d5a1f4d 100644
--- a/include/ust/core.h
+++ b/include/ust/core.h
@@ -141,8 +141,10 @@ static __inline__ int get_count_order(unsigned int count)
 	return order;
 }
 
+#ifndef container_of
 #define container_of(ptr, type, member) ({                      \
         const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
         (type *)( (char *)__mptr - offsetof(type,member) );})
+#endif /* containter_of */
 
 #endif /* UST_CORE_H */
diff --git a/include/ust/kcompat/simple.h b/include/ust/kcompat/simple.h
index 762d802..586b2ed 100644
--- a/include/ust/kcompat/simple.h
+++ b/include/ust/kcompat/simple.h
@@ -28,10 +28,11 @@
  * @member:	the name of the member within the struct.
  *
  */
+#ifndef container_of
 #define container_of(ptr, type, member) ({			\
 	const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
 	(type *)( (char *)__mptr - offsetof(type,member) );})
-
+#endif /* container_of */
 
 /* libkcompat: from rcupdate.h */
 
-- 
1.7.0.4





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ltt-dev] [PATCH] Fixes container_of macro redefinition warnings
  2010-08-16 14:24 [ltt-dev] [PATCH] Fixes container_of macro redefinition warnings David Goulet
@ 2010-08-16 14:34 ` Mathieu Desnoyers
  2010-08-18  4:13 ` Pierre-Marc Fournier
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2010-08-16 14:34 UTC (permalink / raw)


* David Goulet (david.goulet at polymtl.ca) wrote:
> On urcu commit 453629a9317adef5b96c3d55e4dcd98db680997a, the
> container_of macro was moved to urcu/compiler.h. Since, multiple
> warnings appear about redefinition
> 
> Signed-off-by: David Goulet <david.goulet at polymtl.ca>

Thanks!

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

> ---
>  include/ust/core.h           |    2 ++
>  include/ust/kcompat/simple.h |    3 ++-
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/include/ust/core.h b/include/ust/core.h
> index 0172614..d5a1f4d 100644
> --- a/include/ust/core.h
> +++ b/include/ust/core.h
> @@ -141,8 +141,10 @@ static __inline__ int get_count_order(unsigned int count)
>  	return order;
>  }
>  
> +#ifndef container_of
>  #define container_of(ptr, type, member) ({                      \
>          const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
>          (type *)( (char *)__mptr - offsetof(type,member) );})
> +#endif /* containter_of */
>  
>  #endif /* UST_CORE_H */
> diff --git a/include/ust/kcompat/simple.h b/include/ust/kcompat/simple.h
> index 762d802..586b2ed 100644
> --- a/include/ust/kcompat/simple.h
> +++ b/include/ust/kcompat/simple.h
> @@ -28,10 +28,11 @@
>   * @member:	the name of the member within the struct.
>   *
>   */
> +#ifndef container_of
>  #define container_of(ptr, type, member) ({			\
>  	const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
>  	(type *)( (char *)__mptr - offsetof(type,member) );})
> -
> +#endif /* container_of */
>  
>  /* libkcompat: from rcupdate.h */
>  
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> 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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ltt-dev] [PATCH] Fixes container_of macro redefinition warnings
  2010-08-16 14:24 [ltt-dev] [PATCH] Fixes container_of macro redefinition warnings David Goulet
  2010-08-16 14:34 ` Mathieu Desnoyers
@ 2010-08-18  4:13 ` Pierre-Marc Fournier
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Marc Fournier @ 2010-08-18  4:13 UTC (permalink / raw)


Nack.

There's no need for this. UST has explicit minimum requirements on 
liburcu versions. So when the next liburcu is released, the next version 
of UST will simply remove container_of and depend on that new version of 
liburcu. container_of was anyway just a leftover from the port of the 
kernel code.

pmf


On 08/16/2010 10:24 AM, David Goulet wrote:
> On urcu commit 453629a9317adef5b96c3d55e4dcd98db680997a, the
> container_of macro was moved to urcu/compiler.h. Since, multiple
> warnings appear about redefinition
>
> Signed-off-by: David Goulet<david.goulet at polymtl.ca>
> ---
>   include/ust/core.h           |    2 ++
>   include/ust/kcompat/simple.h |    3 ++-
>   2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/include/ust/core.h b/include/ust/core.h
> index 0172614..d5a1f4d 100644
> --- a/include/ust/core.h
> +++ b/include/ust/core.h
> @@ -141,8 +141,10 @@ static __inline__ int get_count_order(unsigned int count)
>   	return order;
>   }
>
> +#ifndef container_of
>   #define container_of(ptr, type, member) ({                      \
>           const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
>           (type *)( (char *)__mptr - offsetof(type,member) );})
> +#endif /* containter_of */
>
>   #endif /* UST_CORE_H */
> diff --git a/include/ust/kcompat/simple.h b/include/ust/kcompat/simple.h
> index 762d802..586b2ed 100644
> --- a/include/ust/kcompat/simple.h
> +++ b/include/ust/kcompat/simple.h
> @@ -28,10 +28,11 @@
>    * @member:	the name of the member within the struct.
>    *
>    */
> +#ifndef container_of
>   #define container_of(ptr, type, member) ({			\
>   	const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
>   	(type *)( (char *)__mptr - offsetof(type,member) );})
> -
> +#endif /* container_of */
>
>   /* libkcompat: from rcupdate.h */
>





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-18  4:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-16 14:24 [ltt-dev] [PATCH] Fixes container_of macro redefinition warnings David Goulet
2010-08-16 14:34 ` Mathieu Desnoyers
2010-08-18  4:13 ` Pierre-Marc Fournier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox