Syslog.h

Tony van der Hoff tony at mk-net.demon.co.uk
Tue May 4 10:57:40 BST 2004


"Jonathan Coxhead" <jonathan at doves.demon.co.uk> wrote in message
<4096822E.7959.170D822 at localhost>

>    On 2 May 2004, at 12:51, Tony van der Hoff wrote:
> 
> > Yes. I guess everything needs os.h (or Hdr.OS) for os_error, so the
> > correct place to fix it is probably in DefMod.
> 
>    Not quite everything needs "os.h":
> 
>    ---"os.h" doesn't need "os.h".
> 
>    ---A module that doesn't define any SWI's (and there are a few) doesn't
need 
> "os.h", probably. (It might do for other reasons, though.)
> 
Yes, that had occurred to me. In the first instance, it is protected by the
guard #ifndef os_H; in the second I considered the overhead to be trivial,
as in any real-world situation os.h will be required in any case. However, I
accept what you're saying, and my proposal is inelegant.

>    So the right place to fix it is not in DefMod: it's in "syslog.swi". It
is 
> annoying that *almost* everything needs "os.h", but it's livable with.
> 
OK, I'll unfix it again :-)

>    A useful test would be to make sure that the following programme
compiles
> 
>       #include TEST
>       int main (void)
>       {
>           return 0;
>       }
> 
> for every value of TEST that is a header file. (Maybe some others have
> slipped through the net?) If you have sh/ksh/bash, something like the
> following could do the job
> 
>       for f in $(find OS: -name "*.h" -print)
>       do
>           h=$(basename $f)
>           cc -c "-DTEST=\"$h\"" -o /dev/null prog.c
>       done
> 
I like that idea in principle. The basic shell script will continue on a
compile error, though. I think I'll try doing something similar in a make
file, which would also work under RISC OS.

Thanks, 
Tony


-- 
Tony van der Hoff
Buckinghamshire England



More information about the oslib-user mailing list