[lkml]   [2000]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Need info on the use of certain datastructures and the first C++ keyword patch for 2.2.17
----- Original Message -----
From: "Alan Cox" <>
To: "Linux Kernel Developer" <>
Cc: <>
Sent: Monday, October 30, 2000 8:04 AM
Subject: Re: Need info on the use of certain datastructures and the first
C++ keyword patch for 2.2.17

> > js_dev::new. My questions are basically this. If I update these data
> > structure members' names along with the references to them in various C
> > files in the kernel will all be happy in Linuxland. Can any external
> That may well be a problem. Also the use of private.
> You may find that creating your own wrappers for these files that do
> extern "C" {
> #define new new_
> #define private private_
> #include <linux/foo.h>
> #undef new
> #undef private
> }
> safer, since you won't break anything

That was one of the two possible solutions I was looking at initially.
Having for example a module.hpp header file alongside module.h which did the
extern "C" {} wrapper along with the #define new lk_new, etc. Actually that
would be an easier task for me as I could easily write a Perl script which
automatically built that for any kernel. However from the responses I
gathered at the time it was mostly recommended against. I am also leary at
that option as some variable (and function?) names would differ when used in
either a C or C++ program and also after having seeing the horror Palm did
with defines in their SDK.
Perhaps this is what I should do. Continue making the straitforward
fixes that will not break anything and incorporate that into my main patch.
Fixes for situations such as the one I encountered in those 3 data
structures I will put into a separate patch for testing to see if the change
affects anybody. If those modifications happen prove unwise then for those
rare cases do the .hpp option on those header files.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:45    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean