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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux