[sane-devel] Re: sane-1.0.6 make-error concerning umax_pp - ongoing 8-(

stef stef-listes@wanadoo.fr
Wed, 21 Nov 2001 08:30:57 +0100


	Hello,

	I finally found why the umax_pp backend fails to compile on PPC arch.
When no libc is found (ie no HAVE_SYS_IO_H is defined) we fall back to including
asm/io.h , the kernel include holds the inb/out macros.
	But on PPC arch, the whole include is protected behin a ifdef __KERNEL__,
where i386 lets the part that defines inb/outb macros is outside it.
	So it seems pointless to me to include asm/io.h on other arch than i386. 

	To solve it, I'm considering to turn:

#ifdef HAVE_SYS_IO_H 
# include <sys/io.h>		/* GNU libc based Linux */
#elif HAVE_ASM_IO_H
# include <asm/io.h>		/* older Linux */
#elif HAVE_SYS_HW_H
# include <sys/hw.h>		/* OS/2 */
#else
#ifdef ENABLE_DIRECTIO
#undef ENABLE_DIRECTIO
#endif
#endif

to:

#ifdef HAVE_SYS_IO_H 
# include <sys/io.h>		/* GNU libc based Linux */
#elif HAVE_ASM_IO_H && defined __i386__
# include <asm/io.h>		/* older Linux */
#elif HAVE_SYS_HW_H
# include <sys/hw.h>		/* OS/2 */
#else
#ifdef ENABLE_DIRECTIO
#undef ENABLE_DIRECTIO
#endif
#endif


	It seems to me that the qcam backend is also affected by this problem.

	Any other idea ?


Regards,
	Stef