浏览代码

avoid compilation error if OGR absent

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39418 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 15 年之前
父节点
当前提交
fbcd6deef3
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      lib/vector/Vlib/field.c

+ 6 - 2
lib/vector/Vlib/field.c

@@ -32,6 +32,10 @@
 #include <gdal_version.h>	/* needed for FID detection */
 #endif	/* HAVE_GDAL */
 
+#ifdef HAVE_OGR
+#include <ogr_api.h>
+#endif
+
 /*!
   \brief Create and init new dblinks structure
   
@@ -476,7 +480,7 @@ int Vect_read_dblinks(struct Map_info *Map)
 	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 */
+#if GDAL_VERSION_NUM > 1320 && HAVE_OGR /* seems to be fixed after 1320 release */
 	int layer, nLayers;
 	OGRDataSourceH Ogr_ds;
 	OGRLayerH Ogr_layer = NULL;
@@ -628,7 +632,7 @@ int Vect_read_dblinks(struct Map_info *Map)
 		}
 	    }
 	}
-#endif /* GDAL_VERSION_NUM > 1320 */
+#endif /* GDAL_VERSION_NUM > 1320 && HAVE_OGR */
 	return (1);
 #endif	/* HAVE_GDAL */
     }