[GRASS-SVN] r39416 - grass/branches/releasebranch_6_4/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 5 17:44:16 EDT 2009


Author: neteler
Date: 2009-10-05 17:44:16 -0400 (Mon, 05 Oct 2009)
New Revision: 39416

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

Modified: grass/branches/releasebranch_6_4/lib/vector/Vlib/field.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/vector/Vlib/field.c	2009-10-05 21:22:20 UTC (rev 39415)
+++ grass/branches/releasebranch_6_4/lib/vector/Vlib/field.c	2009-10-05 21:44:16 UTC (rev 39416)
@@ -30,7 +30,12 @@
 #include <grass/Vect.h>
 
 #include <gdal_version.h>	/* needed for FID detection */
+#include <ogr_api.h>
 
+#ifdef HAVE_OGR
+#include <ogr_api.h>
+#endif
+
 /*!
    \brief Create and init new dblinks ctructure
 
@@ -444,7 +449,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 +599,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