[GRASS-SVN] r72424 - grass/trunk/general/g.version

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 20 11:44:38 PDT 2018


Author: mmetz
Date: 2018-03-20 11:44:37 -0700 (Tue, 20 Mar 2018)
New Revision: 72424

Modified:
   grass/trunk/general/g.version/main.c
Log:
g.version: use new PROJ 5+ API if available

Modified: grass/trunk/general/g.version/main.c
===================================================================
--- grass/trunk/general/g.version/main.c	2018-03-20 18:43:19 UTC (rev 72423)
+++ grass/trunk/general/g.version/main.c	2018-03-20 18:44:37 UTC (rev 72424)
@@ -23,7 +23,11 @@
 
 #include "local_proto.h"
 
+#ifdef HAVE_PROJ_H
+#include <proj.h>
+#else
 #include <proj_api.h>
+#endif
 
 #ifdef HAVE_GDAL
 #include <gdal_version.h>
@@ -187,7 +191,13 @@
 
     if (extended->answer) {
         char *proj = NULL;
+#ifdef HAVE_PROJ_H
+        G_asprintf(&proj, "%d%d%d", PROJ_VERSION_MAJOR,
+	                            PROJ_VERSION_MINOR,
+				    PROJ_VERSION_PATCH);
+#else
         G_asprintf(&proj, "%d", PJ_VERSION);
+#endif
         if (strlen(proj) == 3) {
             if (shell->answer)
                 fprintf(stdout, "proj4=%c.%c.%c\n", proj[0], proj[1], proj[2]); 



More information about the grass-commit mailing list