[K42-discussion] Getting rid of inline linux function problems in C++

Amos Waterland apw at us.ibm.com
Thu Sep 13 07:25:51 EST 2007


On Wed, Sep 12, 2007 at 02:42:52PM -0600, Patrick G. Bridges wrote:
> Anyone have any tricks on how to deal with included (from Linux  
> headers) inline C code that's not legal C++ without changing the base  
> linux source? In particular, asm/thread_info.h on the x86_64 assigns  
> a void * to a typed pointer, which gcc 4 barfs on as illegal C++...

Our general technique, discovered by Michal Ostrowski if I remember
correctly, is illustrated in the following:

 #define private __C__private
 #include <linux/cpu.h>
 #undef private

I hope you can find a pattern in the offending C code that you can
modify in this manner.



More information about the K42-discussion mailing list