[linux-dvb] Re: [PATCH] Implement repeat key handling in budget IR

Trent Piepho xyzzy at speakeasy.org
Mon Feb 26 04:32:25 CET 2007


On Mon, 26 Feb 2007, Oliver Endriss wrote:
> Trent Piepho wrote:
> > The bool type was added here, oct 1 2006:
> > http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6e21828743247270d09a86756a0c11702500dbfb
> >
> > This was for kernel 2.6.19.  It looks like budget-ci is the first v4l-dvb
> > driver to use it, so there wasn't any pre-2.6.19 compat code for it yet.
> >
> > I suggest adding to compat.h:
> >
> > #ifndef bool
> > #define int bool
> > #endif
>
> Well, should be
>   #define bool int

I meant typedef int bool actually, but it doesn't matter.
>
> Anyway, bool is a typedef, and the C preprocessor cannot detect a
> typedef. So your #define would replace all occurrences of bool with int,
> no matter which kernel you run.

You're right.  I also realize that the existing check for #ifndef true in
compat.h doesn't work either!  true and false are part of an enum defined
in linux/stddef.h, not macros.

If compat.h appears before linux/stddef.h, then stddef.h doesn't compile
because of the #define true 1 bit.  But if stddef.h is first, then
everything appears to work.  I thought this must be because the
#ifndef true
in compat.h was working, which wasn't what I expected, but seemed to
explain why there were no errors.  But now I realize that changing true to
1 on current kernels, while unnecessary, isn't actually going to cause a
problem (other than the definition of true in stddef.h).



More information about the linux-dvb mailing list