[Radiance-dev] SPEED or no SPEED
schorsch at schorsch.com
Mon Sep 19 18:16:34 CEST 2005
Randolph Fritz wrote:
> Greg Ward wrote:
> > Your description of -DBSD is fine. I forgot about
> > compile_switches. I just noticed (and fixed) the fact that -
> > DALIGN= was changed to -DALIGNT=. If there's some way to get rid
> > of -DBSD, that would be great. We seem to need it for the resource
> > stuff at the moment.
> I think it changes he behavior of some library routines on some
> systems that support both BSD-like and POSIX-like code, but I'm not
> entirely sure of that. On Mac OS X it is actually defined in <sys/
> param.h>--anyone know about other implementations?
FreeBSD has it defined in the same place as follows:
#define BSD 199506 /* System version (year & month). */
It doesn't influence anything else as it seems (and I don't
think it really should, either).
The question is rather how we get rid of those instances
in our own code where it makes Radiance behave differently.
There seem to be three problem areas:
In rpict.c, it includes resource.h, which is necessary
for getrusage(). I can't do a comprehensive check, but on
those BSDish systems I have access to, the SYSV times()
call is also available, so we could probably switch to that
on all posix platforms. We still need a seperate report()
function for Windows, of course.
In random.h, BSD uses random() instead of lrand48()/drand48().
The latter also seem to be available everywhere nowadays,
so we could switch this one too.
The last issue is the different behaviour when IO calls are
interrupted. This is handled by readbuf()/writebuf() in
process.c, which gets called from various places. I have no
idea whether this problem still exists (probably) or if there
are other ways to work around it.
Georg Mischler -- simulations developer -- schorsch at schorsch com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/
More information about the Radiance-dev