[dpdk-dev] [PATCH] headers: typeof -> __typeof__ to unbreak C++11 code

Ananyev, Konstantin konstantin.ananyev at intel.com
Fri Mar 6 11:30:50 CET 2015


Hi Simon,

> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Simon Kågström
> Sent: Friday, March 06, 2015 8:28 AM
> To: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] headers: typeof -> __typeof__ to unbreak C++11 code
> 
> Ping? Konstantins simpler patch is fine for me, but at least one of
> these two would be very nice to have so that modern C++ code can use DPDK.
> 
> // Simon

Can you do v2 as suggested, or do you want me to do it?
Thanks
Konstantin

> 
> On 2015-03-02 08:55, Simon Kågström wrote:
> > On 2015-02-27 17:24, Ananyev, Konstantin wrote:
> >> Actually, I wonder wouldn't something like the one below be sufficient?
> >>
> >> diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/
> >> index 8ac940c..1867692 100644
> >> --- a/lib/librte_eal/common/include/rte_common.h
> >> +++ b/lib/librte_eal/common/include/rte_common.h
> >> @@ -51,6 +51,15 @@ extern "C" {
> >>  #include <errno.h>
> >>  #include <limits.h>
> >>
> >> +#ifndef typeof
> >> +#define typeof __typeof__
> >> +#endif
> >> +
> >> +#ifndef asm
> >> +#define asm __asm__
> >> +#endif
> >
> > Yes, I've tested, and this works with g++ as well.
> >
> > // Simon
> >


More information about the dev mailing list