[linux-dvb] [BUG] usage of undefined macros in dvb header files

Johannes Stezenbach js at linuxtv.org
Thu Mar 10 13:52:51 CET 2005

Nico Sabbi wrote:
> on kernels that don't have __iomem and __iouser defined,
> especially distributions with patched kernel headers that have funny 
> version names
> like, compilation of dvb drivers (and applications 
> that use them)
> _always_ fails because those macros are required by dvb header files.
> I understand that this bug is related to the kernel rather than to dvb,
> and I guess that the check to define these macros as empty  for older
> kernels is done badly,  still dvb drivers and applications are affected,
> so I hope someone  of you developers will find a definitive fix to this 
> never
> ending problem.

The problem is actually that the includes that come with glibc
are out of date. On a recent distribution you have DVB includes
in /usr/include/linux/dvb/ and a /usr/include/linux/compiler.h
that defines __user. When you mess with the files in
/usr/include/linux/dvb/, or you use -I.../dvb-kernel/include
then it's your fault if you don't supply a matching __user
definition (-D__user).

I don't know if the policy has changed, but AFAIK Linus does
not like userspace compatibility cruft in kernel includes,
i.e. he does (did?) not accept patches with #ifdef __KERNEL
cruft in it. (There's a separate project to get around that:

Likely I guess he would not like
  #if !defined(__user)
  #define __user
repeated in all DVB API headers.

But of course I see the problem with backwards compatibility.
The only way to solve it cleanly would be to have a "dvb-dev"
package that installs compatible API headers in /usr/include/dvb/.
(Or you add a cleaned copy of the API headers to your source tree
(like xawtv does it with v4l headers).)
I don't like both ;-/


More information about the linux-dvb mailing list