Defines in swig interface files

Tamas Szekeres szekerest at GMAIL.COM
Mon Aug 28 09:53:00 EDT 2006


In my previous post i have noted that suppressing the compilation
swiches may result in unexpected interface creation.
For example missing -DUSE_POINT_Z_M will prevent from generating z and m members
for pointObj etc.

I've added a bug for this issue:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1881

Tamas


2006/8/28, Umberto Nicoletti <umberto.nicoletti at gmail.com>:
> 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