[geos-commits] r3654 - in trunk: . capi

svn_geos at osgeo.org svn_geos at osgeo.org
Tue May 29 03:04:16 PDT 2012


Author: strk
Date: 2012-05-29 03:04:15 -0700 (Tue, 29 May 2012)
New Revision: 3654

Modified:
   trunk/Makefile.am
   trunk/capi/geos_ts_c.cpp
Log:
Include SVN revision in GEOSversion output

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2012-05-29 10:04:05 UTC (rev 3653)
+++ trunk/Makefile.am	2012-05-29 10:04:15 UTC (rev 3654)
@@ -21,7 +21,7 @@
 EXTRA_DIST = acsite.m4 makefile.vc nmake.opt autogen.bat CMakeLists.txt \
   cmake/modules/CheckPrototypeExists.cmake \
   cmake/modules/COPYING-CMAKE-SCRIPTS \
-  cmake/cmake_uninstall.cmake.in
+  cmake/cmake_uninstall.cmake.in geos_svn_revision.h
 
 ACLOCAL_AMFLAGS = -I macros
 
@@ -36,3 +36,8 @@
 
 svnrebase: authors.git
 	cd $(srcdir) && git svn rebase --authors-file authors.git
+
+geos_svn_revision.h:
+	sh tools/svn_repo_revision.sh $<
+
+.PHONY: geos_svn_revision.h

Modified: trunk/capi/geos_ts_c.cpp
===================================================================
--- trunk/capi/geos_ts_c.cpp	2012-05-29 10:04:05 UTC (rev 3653)
+++ trunk/capi/geos_ts_c.cpp	2012-05-29 10:04:15 UTC (rev 3654)
@@ -93,6 +93,7 @@
 #define GEOSWKBWriter_t geos::io::WKBWriter
 
 #include "geos_c.h"
+#include "../geos_svn_revision.h"
 
 // Intentional, to allow non-standard C elements like C99 functions to be
 // imported through C++ headers of C library, like <cmath>.
@@ -3273,7 +3274,9 @@
 
 const char* GEOSversion()
 {
-    return GEOS_CAPI_VERSION;
+  static char version[256];
+  sprintf(version, "%s r%d", GEOS_CAPI_VERSION, GEOS_SVN_REVISION);
+  return version;
 }
 
 const char* GEOSjtsport()



More information about the geos-commits mailing list