[Insight-developers] ITK with SunPro compilers

Miller, James V (Research) millerjv@crd.ge.com
Wed, 4 Sep 2002 12:11:15 -0400


I am in the process of trying this out.

I change the macro slightly to make it match the other ITK macros

itkStaticConstMacro(name, type, value)

When you need to use the "constant" as a template parameter, there is another
macro to call (to get around differences between the compilers needed fully scoped
paths to constants). Below is an example

  itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
  typedef Vector<TScalarType,
                 itkGetStaticConstMacro(SpaceDimension)>  InputVectorType;



> -----Original Message-----
> From: Brad King [mailto:brad.king@kitware.com]
> Sent: Wednesday, September 04, 2002 11:46 AM
> To: Miller, James V (Research)
> Cc: Insight Developers
> Subject: RE: [Insight-developers] ITK with SunPro compilers
> 
> 
> > Does this look like the macro we need? I change the 
> suggested name of
> > the macro from ITK_STATIC_CONST to itkStaticConstMacro to make is
> > consistent with our itkSetMacro(), itkNewMacro() etc.
> >
> >
> > #if defined(_MSC_VER) && (_MSC_VER <= 1300)
> > #   define ITK_NO_INCLASS_MEMBER_INITIALIZATION
> > #endif
> > #if defined(__SUBPRO_CC) && (__SUNPRO_CC <= 0x520)
> > #   define ITK_NO_INCLASS_MEMBER_INITIALIZATION
> > #endif
> >
> > #ifdef ITK_NO_INCLASS_MEMBER_INITIALIZATION
> > #     define itkStaticConstMacro(type, assignment) enum { 
> assignment }
> > #else
> > #     define itkStaticConstMacro(type, assignment) static 
> const type assignment
> > #endif
> 
> Yes, this is it exactly.  Good call on the name change.  This 
> will need to
> be used for all the ImageDimension enumeration values we 
> currently have.
> 
> -Brad
>