Defines in swig interface files

Umberto Nicoletti umberto.nicoletti at GMAIL.COM
Mon Aug 28 06:33:00 EDT 2006


I have noticed that some swig interface files have #ifdef in them
(list follows).
Unfortunately they are completely useless as swig cannot pick them up
because the needed defines are not passed to swig in the Makefile.
The only exception to this rule is c# mapscript. Java mapscript used
to pass the defines to swig, but this was removed some time ago.

swiginc/image.i:#if GD2_VERS > 1   Not sure about this one, maybe it
is right.....
swiginc/image.i:#ifdef USE_GD_GIF
swiginc/image.i:#ifdef USE_GD_PNG
swiginc/image.i:#ifdef USE_GD_JPEG
swiginc/image.i:#ifdef USE_GD_WBMP
swiginc/point.i:#ifdef USE_POINT_Z_M
swiginc/point.i:#ifdef USE_POINT_Z_M
swiginc/point.i:#ifdef USE_POINT_Z_M
swiginc/point.i:#ifdef USE_POINT_Z_M
swiginc/point.i:#ifdef USE_POINT_Z_M
swiginc/point.i:#ifdef USE_POINT_Z_M
swiginc/shape.i:#ifdef USE_GEOS
swiginc/shape.i:#ifdef USE_GEOS

The convention which was never written and if it was I cannot find
where is that defines must only go into the .c and .h files to keep
the swig interface as simple as possible.
Sean Gillies can probably confirm this.

At this point it is too late to fix this issue for 4.10. I think in
the meanwhile we'll should decide if we are to stick with this
convention and after 4.10 is out move the defines (if needed).

I can open a bug to track this issue and maybe we should write an rfc
with coding conventions for mapscript developers?

Umberto



More information about the mapserver-dev mailing list