Ver código fonte

Fix `--without-gdal'.
lib/vector/Vlib/field.c
(gdal_version.h): Include only if `HAVE_GDAL' is defined.
(Vect_read_dblinks): Guard a part of code with `#ifdef HAVE_GDAL'.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36464 15284696-431f-4ddb-bdfa-cd5b030d7da7

Ivan Shmakov 16 anos atrás
pai
commit
251a6a5cf9
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      lib/vector/Vlib/field.c

+ 7 - 0
lib/vector/Vlib/field.c

@@ -29,7 +29,9 @@
 #include <grass/dbmi.h>
 #include <grass/Vect.h>
 
+#ifdef HAVE_GDAL
 #include <gdal_version.h>	/* needed for FID detection */
+#endif	/* HAVE_GDAL */
 
 /*!
    \brief Create and init new dblinks ctructure
@@ -444,6 +446,10 @@ int Vect_read_dblinks(struct Map_info *Map)
     G_debug(3, "Searching for FID column in OGR DB");
     if (Map->format == GV_FORMAT_OGR) {
 
+#ifndef HAVE_GDAL
+	G_fatal_error(_("The support for OGR vector maps wasn't"
+			" compiled in."));
+#else
 #if GDAL_VERSION_NUM > 1320	/* seems to be fixed after 1320 release */
 	int layer, nLayers;
 	OGRDataSourceH Ogr_ds;
@@ -596,6 +602,7 @@ int Vect_read_dblinks(struct Map_info *Map)
 	}
 #endif /* GDAL_VERSION_NUM > 1320 */
 	return (1);
+#endif	/* HAVE_GDAL */
     }
     else if (Map->format != GV_FORMAT_NATIVE) {
 	G_fatal_error(_("Don't know how to read links for format %d"),