Re: [PATCH] C++ breaks on linux/ioport.h

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Thu Apr 27 2000 - 19:07:32 EST


Manfred Spraul wrote:
> Dominik Kubla wrote:
> > extern "C" {
> > #include <linux/header1.h>
> > #include <linux/header2.h>
> > ...
> > }
>
> I tried that a few weeks ago:
> 3 or 4 header files contain variables with the names
>
> new
> virtual
>
> new is reserved, and virtual caused a parse error somewhere in an inline
> function (page->virtual).

That's because Domonik really meant:

   extern "C" {
     #define new c_new
     #define virtual c_virtual
     #include <linux/header1.h>
     #include <linux/header2.h>
     #undef new
     #undef virtual
   }

have a nice day,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:14 EST