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

RE: Bug#116772: [hpoj-devel] Re: Bug#116772: hpoj: failed to buil d on m68k.



Mark Purcell wrote:
> I have isolated the problem. I was pretty sure you were 
> already checking for
> the existence of sys/io.h and you were in the config script.
Not completely.  The intention was to check for the ability to include
sys/io.h from C++ code, but if that fails, it (incorrectly) assumes that
sys/io.h can be included from C code, enables ioWrapper.c to be compiled and
linked in, and adds the BROKEN_IO_H define.  I'm working on correcting this
in the configure script.

> The problem was a typo in ioWrapper.c
> 
> --- hpoj-0.8.orig/mlcd/ioWrapper.c
> +++ hpoj-0.8/mlcd/ioWrapper.c
> @@ -24,8 +24,9 @@
>  #error Must be compiled as C, not C++
>  #endif
> 
> -#undef BROKEN_IO_H
> +#ifdef BROKEN_IO_H
>  #include "ioWrapper.h"
> +#endif
> 
>  int ioplWrapper(int level) {
>         return iopl(level);
That wasn't a typo.  Although your change makes it compile, the existence of
the BROKEN_IO_H macro, which is always present when ioWrapper.c is compiled
anyway, causes ioWrapper.h to redefine iopl() to ioplWrapper(), etc.,
thereby causing infinite recursion where ioplWrapper inadvertently calls
itself.

David



Reply to: