From: paul k. <pau...@xs...> - 2005-05-06 07:39:46
|
This is strange. Look what my first part of the i2c.h looks like. /* ------------------------------------------------------------------------- */ /* */ /* i2c.h - definitions for the i2c-bus interface */ /* */ /* ------------------------------------------------------------------------- */ /* Copyright (C) 1995-2000 Simon G. Vogl This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ------------------------------------------------------------------------- */ /* With some changes from Kyösti Mälkki <km...@cc...> and Frodo Looijaard <fr...@dd...> */ /* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */ #ifndef _LINUX_I2C_H #define _LINUX_I2C_H #ifdef __KERNEL__ # include <linux/module.h> # include <linux/types.h> #else # define __KERNEL__ # include <linux/types.h> # undef __KERNEL__ #endif #include <linux/i2c-id.h> #ifdef __KERNEL__ #include <linux/device.h> /* for struct device */ #include <asm/semaphore.h> Same file revision, only different contents. I am now first going to check, if gentoo apply patches to these headers files. This is really strange. Paul Michael Reinelt wrote: >Hi Paul, > > > > >>I still think that somehow you're building for kernel space. The reason >>for this is the following items in your output: >> >> >> >>>------------------------------------------------------------------------ >>> >>>In file included from /usr/include/linux/sched.h:12, >>> from /usr/include/linux/module.h:10, >>> from /usr/include/linux/i2c.h:31, >>> from test-i2c.c:6: >>>/usr/include/linux/jiffies.h:385:41: division by zero in #if >>> >>> >>> >>> >>This module.h is only included (on my system) when __KERNEL__ is defined >>when compiling i2c.h >> >> > >No, not here: > >merlin:~ $ more /usr/include/linux/i2c.h >/*--------------------------------------------------------------------*/ >/* */ >/* i2c.h - definitions for the i2c-bus interface */ >/* */ >/*--------------------------------------------------------------------*/ >/* Copyright (C) 1995-2000 Simon G. Vogl > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > */ >/*--------------------------------------------------------------------*/ > >/* With some changes from Kyösti Mälkki <km...@cc...> and > Frodo Looijaard <fr...@dd...> */ > >/* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */ > >#ifndef _LINUX_I2C_H >#define _LINUX_I2C_H > >#include <linux/module.h> >#include <linux/types.h> >#include <linux/i2c-id.h> >#include <linux/device.h> /* for struct device */ >#include <asm/semaphore.h> > >There's no #ifdef __KERNEL__ around here... > > > >>Which version of the kernel headers are you using? That warning message >>in list.h is on line 713 on my system. >> >> >Line 705 or so here. Ther header files are from a vanilla 2.6.11 kernel > > > >>On more thing to check is >>gcc -v -E -dM test-i2c.c > defines-test-i2c.lst >>gcc -v -E -dM test-i2c.c 2> defines-test-i2c2.lst >> >> > >Too big for the mailing list, I'll send them with a PM to Paul only. > >I think the i2c.h file from the kernel ist simply not intended for >userspace programs... if this is true, we have to create our own i2c.h... > > >bye, Michael > > > |