Macro/enum clash for kpty.h and kprinter.h headers

Richard Dale richard_dale at tipitina.demon.co.uk
Tue Jun 19 18:50:32 BST 2007


On Tuesday 19 June 2007, Richard Dale wrote:
> I'm having trouble with some source code where there is an include
> for 'kpty.h' after an include for 'kprinter.h'. Then the following code
> tries to use the enum PageSize::B0 from kprinter.h and it doesn't compile
> because the 'B0' has been defined as a macro via the kpty.h include.
>
> So should there be an '#if defined(B0) #undef B0' in kpty.h after the
> termios.h include to prevent these two kde headers from interfering with
> each other unpredictably?
>
> -- Richard

To clarify, I meant change the kpty.h header to look like this and undefine 
B0:


/* for HP-UX (some versions) the extern C is needed, and for other
   platforms it doesn't hurt */
extern "C" {
#include <termios.h> // struct termios
}

#if defined(B0)
#undef B0 // Terminal hang-up.  We assume that you do not want that.
#endif






More information about the kde-core-devel mailing list