[mapserver-commits] r7875 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Aug 20 17:06:10 EDT 2008
Author: dmorissette
Date: 2008-08-20 17:06:10 -0400 (Wed, 20 Aug 2008)
New Revision: 7875
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/Makefile.in
trunk/mapserver/configure
trunk/mapserver/configure.in
trunk/mapserver/maperror.c
trunk/mapserver/mapserver.h
Log:
Added MS_VERSION_NUM for use with #if statements in code based on
libmapserver (#2750)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2008-08-20 18:33:42 UTC (rev 7874)
+++ trunk/mapserver/HISTORY.TXT 2008-08-20 21:06:10 UTC (rev 7875)
@@ -12,6 +12,9 @@
Current Version (5.3-dev, SVN trunk):
------------------------------------
+- Added MS_VERSION_NUM for use with #if statements in code based on
+ libmapserver (#2750)
+
- Fixed the configure script: failed to detect php5 on ubuntu. (#2365)
- Fixed a memory leak associated with not deleting the lexer buffer
Modified: trunk/mapserver/Makefile.in
===================================================================
--- trunk/mapserver/Makefile.in 2008-08-20 18:33:42 UTC (rev 7874)
+++ trunk/mapserver/Makefile.in 2008-08-20 21:06:10 UTC (rev 7875)
@@ -369,7 +369,7 @@
echo -I. $(PROJ_INC) $(GD_INC) $(TTF_INC) $(TIFF_INC) $(JPEG_INC) $(SDE_INC) $(OGR_INC) $(GDAL_INC) $(GEOS_INC) >> mapscriptvars
echo $(EXE_LDFLAGS) >> mapscriptvars
echo $(STATIC_LIBS) >> mapscriptvars
- grep '#define MS_VERSION' mapserver.h >> mapscriptvars
+ grep '#define MS_VERSION ' mapserver.h >> mapscriptvars
mapserver-config: Makefile
rm -f mapserver-config
@@ -379,7 +379,7 @@
echo 'CONFIG_CFLAGS="$(CFLAGS)"' >> mapserver-config
echo 'CONFIG_DEFINES="$(DEFINES)"' >> mapserver-config
echo 'CONFIG_INCLUDES="$(INCLUDES)"' >> mapserver-config
- echo 'CONFIG_VERSION="'`grep '#define MS_VERSION' mapserver.h | sed 's/\"//g' | sed 's/#define MS_VERSION //'`'"' >> mapserver-config
+ echo 'CONFIG_VERSION="'`grep '#define MS_VERSION ' mapserver.h | sed 's/\"//g' | sed 's/#define MS_VERSION //'`'"' >> mapserver-config
cat mapserver-config.in >> mapserver-config
chmod a+x mapserver-config
Modified: trunk/mapserver/configure
===================================================================
--- trunk/mapserver/configure 2008-08-20 18:33:42 UTC (rev 7874)
+++ trunk/mapserver/configure 2008-08-20 21:06:10 UTC (rev 7875)
@@ -4967,7 +4967,7 @@
STRINGS=$STRINGS
-MS_VERSION=`grep MS_VERSION mapserver.h | grep '#define' | cut -d\" -f2`
+MS_VERSION=`grep 'MS_VERSION ' mapserver.h | grep '#define' | cut -d\" -f2`
{ echo "$as_me:$LINENO: result: MapServer Version from mapserver.h: '$MS_VERSION'" >&5
echo "${ECHO_T}MapServer Version from mapserver.h: '$MS_VERSION'" >&6; }
MS_VERSION="$MS_VERSION"
Modified: trunk/mapserver/configure.in
===================================================================
--- trunk/mapserver/configure.in 2008-08-20 18:33:42 UTC (rev 7874)
+++ trunk/mapserver/configure.in 2008-08-20 21:06:10 UTC (rev 7875)
@@ -75,7 +75,7 @@
dnl ---------------------------------------------------------------------
dnl Look for MapServer version in mapserver.h
dnl ---------------------------------------------------------------------
-MS_VERSION=`grep MS_VERSION mapserver.h | grep '#define' | cut -d\" -f2`
+MS_VERSION=`grep 'MS_VERSION ' mapserver.h | grep '#define' | cut -d\" -f2`
AC_MSG_RESULT([MapServer Version from mapserver.h: '$MS_VERSION'])
AC_SUBST(MS_VERSION, "$MS_VERSION")
Modified: trunk/mapserver/maperror.c
===================================================================
--- trunk/mapserver/maperror.c 2008-08-20 18:33:42 UTC (rev 7874)
+++ trunk/mapserver/maperror.c 2008-08-20 21:06:10 UTC (rev 7875)
@@ -579,25 +579,5 @@
int msGetVersionInt()
{
- static int version = 0;
-
- /* Parse MS_VERSION only once */
- if (version == 0)
- {
- char **tokens = NULL;
- int n = 0;
- tokens = msStringSplit(MS_VERSION, '.', &n);
- if (n<3)
- {
- msSetError(MS_MISCERR, "Invalid version string: %s", "msGetVersionInt()", MS_VERSION);
- }
- else
- {
- version = atoi(tokens[0])*10000 + atoi(tokens[1])*100 + atoi(tokens[2]);
- }
- if (tokens)
- msFreeCharArray(tokens, n);
- }
-
- return version;
+ return MS_VERSION_NUM;
}
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2008-08-20 18:33:42 UTC (rev 7874)
+++ trunk/mapserver/mapserver.h 2008-08-20 21:06:10 UTC (rev 7875)
@@ -30,8 +30,20 @@
#ifndef MAP_H
#define MAP_H
-/* $Id$
-**
+/*
+** MapServer version - to be updated for every release
+*/
+
+#define MS_VERSION "5.3-dev"
+
+#define MS_VERSION_MAJOR 5
+#define MS_VERSION_MINOR 3
+#define MS_VERSION_REV 0
+
+#define MS_VERSION_NUM (MS_VERSION_MAJOR*10000+MS_VERSION_MINOR*100+MS_VERSION_REV)
+
+
+/*
** Main includes. If a particular header was needed by several .c files then
** I just put it here. What the hell, it works and it's all right here. -SDL-
*/
@@ -119,8 +131,6 @@
/* General defines, wrapable */
-#define MS_VERSION "5.3-dev"
-
#define MS_TRUE 1 /* logical control variables */
#define MS_FALSE 0
#define MS_ON 1
More information about the mapserver-commits
mailing list