[MINC-development] ABS and SIGN

Andrew Janke minc-development@bic.mni.mcgill.ca
Wed, 18 Jun 2003 09:35:01 +1000


On Tue, 17 Jun 2003, Steve ROBBINS wrote:

> On Tue, Jun 17, 2003 at 01:24:54PM -0400, Robert VINCENT wrote:
> > Hi Vicka,
> >
> > While I know there are some "namespace pollution" issues with MINC, I'm a
> > little surprised that this is causing a problem, since none of these
> > symbols is defined in the public "minc.h" header file.
>
> Maybe they are using volume_io: SIGN is defined in <volume_io/basic.h>.  That
> header is one of the worst offenders: it's got MIN, MAX, TRUE, FALSE, PI, ON,
> etc etc.

This has come up a number of times before, my biggest whinge MAX, MIN et al
aside is that #defines exist for X, Y and Z! (in volume_io/geom_structs.h).

This means that should you wish to include volume_io and some GSL routines you
can't as some of the arguments to functions in GSL are things like matrix *X!

> How about we make "clean up the namespace" a release goal for MINC 1.2?  What
> needs some thought is providing backward compatibility for clients of the
> library who do use these symbols.  Mainly the decision is: do we make current
> users do something special to define the symbols, or do we make future users
> do something special to get a clean namespace?  Where "something special" is
> either "#define a symbol" or "#include a different header".

My suggestion is to break volume_io in the new version and make old programs
include something such as old_volume_io.h that includes one extra file:
volume_io/broken_defines.h this should only be a problem for Dave Mc's proggies.
I have never (knowingly) used the 'naughty' #defines in volume_io but will
probably be proved wrong here. ;)

Then we should prefix all current volume_io #defines with something like
VOLIO_ (GNU'ish style). This should all be fine unless the "other" volio brain
library comes into play with it's own #defines...

  re:  http://eivind.imm.dtu.dk/staff/kjems/volio/


--
Andrew Janke   ( rotor@cmr.uq.edu.au || www.cmr.uq.edu.au/~rotor )
Australia->University of Queensland->Centre for Magnetic Resonance
Work: +61 7 3365 4100 || Home: +61 7 3800 4042