Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2750 closed enhancement (fixed)

Added MS_VERSION_NUM to mapserver.h to make it easier to detect changes

Reported by: woodbri Owned by: dmorissette
Priority: normal Milestone: 5.4 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: dmorissette, sdlime

Description (last modified by dmorissette)

From email exchanged on dev list:

You could look at the way the Apache version string is parsed in MapServer's
configure.in.

To mkae this simpler in the future, perhaps it's time to add MS_VERSION_NUM to
mapserver.h similar to what we have in GDAL, e.g.

#ifndef MS_VERSION_MAJOR
#  define MS_VERSION_MAJOR    5
#  define MS_VERSION_MINOR    2
#  define MS_VERSION_REV      0
#endif

#ifndef MS_VERSION_NUM
#  define MS_VERSION_NUM (MS_VERSION_MAJOR*10000+MS_VERSION_MINOR*100+MS_VERSION_REV)
#endif

Then your code could use

#if MS_VERSION_NUM >= 50200

If you file a ticket and there are no objections then I'll add this. We could also backport to 5.2.1 to make this useful immediately.

Daniel

Change History (4)

comment:1 by dmorissette, 16 years ago

Owner: changed from sdlime to dmorissette
Status: newassigned

comment:2 by dmorissette, 16 years ago

Cc: sdlime added

comment:3 by dmorissette, 16 years ago

Milestone: 5.2.1 release5.4 release
Resolution: fixed
Status: assignedclosed

MS_VERSION_NUM added in SVN trunk r7875.

In addition to the new defines, changes were also required in the configure script and Makefiles which were doing grep's on the mapserver.h files and had their tests broken by the new defines. I also updated msGetVersionInt() to just return MS_VERSION_NUM instead of parsing MS_VERSION as it used to do.

I will NOT backport to 5.2.x... there are too many changes.

comment:4 by dmorissette, 16 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.