[GRASS-SVN] r39417 - grass/branches/develbranch_6/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 5 17:46:26 EDT 2009


Author: neteler
Date: 2009-10-05 17:46:25 -0400 (Mon, 05 Oct 2009)
New Revision: 39417

Modified:
   grass/branches/develbranch_6/lib/vector/Vlib/field.c
Log:
avoid compilation error if OGR absent

Modified: grass/branches/develbranch_6/lib/vector/Vlib/field.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/field.c	2009-10-05 21:44:16 UTC (rev 39416)
+++ grass/branches/develbranch_6/lib/vector/Vlib/field.c	2009-10-05 21:46:25 UTC (rev 39417)
@@ -31,6 +31,10 @@
 
 #include <gdal_version.h>	/* needed for FID detection */
 
+#ifdef HAVE_OGR
+#include <ogr_api.h>
+#endif
+
 /*!
    \brief Create and init new dblinks ctructure
 
@@ -444,7 +448,7 @@
     G_debug(3, "Searching for FID column in OGR DB");
     if (Map->format == GV_FORMAT_OGR) {
 
-#if GDAL_VERSION_NUM > 1320	/* seems to be fixed after 1320 release */
+#if GDAL_VERSION_NUM > 1320 && HAVE_OGR	/* seems to be fixed after 1320 release */
 	int layer, nLayers;
 	OGRDataSourceH Ogr_ds;
 	OGRLayerH Ogr_layer = NULL;
@@ -594,7 +598,7 @@
 		}
 	    }
 	}
-#endif /* GDAL_VERSION_NUM > 1320 */
+#endif /* GDAL_VERSION_NUM > 1320 && HAVE_OGR */
 	return (1);
     }
     else if (Map->format != GV_FORMAT_NATIVE) {



More information about the grass-commit mailing list