Conflict of 'new' keyword when including C header files into C++ modules
Philip Prindeville
philipp_subx@redfish-solutions.com
Wed Jan 5 01:47:00 GMT 2011
I'm working on the Click project (see attached) which uses a couple of C++ modules that link into the Linux (or BSD) kernel.
The problem is that linux header files include various constructs that C++ chokes on, like:
=== include/linux/list.h
...
static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
and the problem is that this requires patching a lot of code, which makes porting Click to newer kernel versions labor intensive.
I was wondering why header files that are bracketed as:
extern "C" {
#include <linux/list.h>
...
}
still have a problem with this. Do the C++ keywords still exist while in the "C" space?
What's the easiest work-around?
Thanks,
-Philip
-------------- next part --------------
An embedded message was scrubbed...
From: Joonwoo Park <joonwpark81@gmail.com>
Subject: Re: [Click] Minimizing patch size
Date: Tue, 4 Jan 2011 12:25:33 -0800
Size: 7734
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20110105/4d968de1/attachment.eml>
More information about the Gcc-help
mailing list