[PATCH] remove #ifdef __KERNEL__ from atomic.h

Paul Mackerras paulus at samba.org
Wed Sep 25 17:44:07 EST 2002


Ben Stanley writes:

> I was trying to compile sumji (formerly xtunes), which requires
> libCommonC++. I found that libCommonC++ would not compile, because it
> needs to use the atomic functions declared in include/asm-ppc/atomic.h .
> However, this file does not declare these functions unless __KERNEL__ is
> defined. I believe that this is incorrect.

This has been gone over many times, user programs shouldn't be using
kernel headers.  I don't mind if you change /usr/include/asm/atomic.h,
that's a glibc header not a kernel header, but the #ifdef __KERNEL__
in the kernel header is there precisely to catch this sort of error.

(And of course /usr/include/asm should NOT be a symlink into the
kernel sources.)

Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list