Pārlūkot izejas kodu

fix https://trac.osgeo.org/grass/changeset/70259 for GDAL 1.x

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@70282 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 gadi atpakaļ
vecāks
revīzija
c797a89997
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 1
      db/drivers/ogr/describe.c

+ 9 - 1
db/drivers/ogr/describe.c

@@ -106,7 +106,11 @@ int describe_table(OGRLayerH hLayer, dbTable **table, cursor *c)
 	ogrType = OGR_Fld_GetType(hFieldDefn);
 	fieldName = OGR_Fld_GetNameRef(hFieldDefn);
 
-	if (ogrType != OFTInteger && ogrType != OFTInteger64 && ogrType != OFTReal &&
+	if (ogrType != OFTInteger &&
+#if GDAL_VERSION_NUM >= 2000000
+            ogrType != OFTInteger64 &&
+#endif
+            ogrType != OFTReal &&
 	    ogrType != OFTString  && ogrType != OFTDate &&
 	    ogrType != OFTTime    && ogrType != OFTDateTime ) {
 	    G_warning(_("OGR driver: column '%s', OGR type %d is not supported"),
@@ -171,13 +175,17 @@ int describe_table(OGRLayerH hLayer, dbTable **table, cursor *c)
 
 	switch (ogrType) {
 	case OFTInteger:
+#if GDAL_VERSION_NUM >= 2000000
         case OFTInteger64:
+#endif
 	    sqlType = DB_SQL_TYPE_INTEGER;
 	    size = OGR_Fld_GetWidth(hFieldDefn);	/* OK ? */
 	    precision = 0;
+#if GDAL_VERSION_NUM >= 2000000
             if (ogrType == OFTInteger64)
                 G_warning(_("Column '%s' : type int8 (bigint) is stored as integer (4 bytes) "
                             "some data may be damaged"), fieldName);
+#endif
 	    break;
 
 	case OFTReal: