Ticket #1890 (closed defect: fixed)
swig interface files contain preprocessor directives that will be ignored by swig
|Reported by:||unicoletti||Owned by:||unicoletti|
While doing the usual house keeping before 4.10 gets out I have looked at the source of the swig interface files and found that they contain preprocessor defines (#ifdef USE_GEOS for example). Most of the mapscript laguages will ignore these defines because swig is not passed the list of options built by configure. Java mapscript used to pass the list to swig, but this feature was removed a long time ago because Sean opted for removing the preprocessor defines from the swig interface files to keep them tidier. C# mapscript at this point is the only laguage still passing defines to swig. Perl, Ruby and Python invoke swig without passing the defines; also, in the case of Perl and Python swig must be run manually by the user (by typing the right command in the shell). Now since most mapscript will ignore those preprocessor defines we are facing a potentially critical issue and, in the case of GEOS, mapscript won't use some GEOS functions. Other possible errors could be memory errors due to the use of non initialized variables (this is the case of POINT_Z_M). I have reviewed the swig interface files and found these possibly harmful defines: swiginc/image.i:#if GD2_VERS > 1 Not sure about this one, maybe it is right. Dunno where GD2_VERS is defined. 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 These were added by Sean in July 04 and should be removed, I guess. They only affect TCL. 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 These are *rarely* used and they are not a real problem, at least for 4.10. If used they crash Java mapscript for sure. swiginc/shape.i:#ifdef USE_GEOS swiginc/shape.i:#ifdef USE_GEOS These were added by sdlime on his lates rework of geos code this june. They should be moved out of the swig interface file into the c code of mapserver
Note: See TracTickets for help on using tickets.