Browse Source

v.in.ogr: add #ifdefs to fix https://trac.osgeo.org/grass/changeset/66726

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@66729 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 9 years ago
parent
commit
99e3134fd5
1 changed files with 10 additions and 2 deletions
  1. 10 2
      vector/v.in.ogr/main.c

+ 10 - 2
vector/v.in.ogr/main.c

@@ -1006,7 +1006,11 @@ int main(int argc, char *argv[])
                 /* check if the field is integer */
                 Ogr_field = OGR_FD_GetFieldDefn(Ogr_featuredefn, key_idx);
                 Ogr_ftype = OGR_Fld_GetType(Ogr_field);
-                if (!(Ogr_ftype == OFTInteger || Ogr_ftype == OFTInteger64)) {
+                if (!(Ogr_ftype == OFTInteger
+#if GDAL_VERSION_NUM >= 2000000
+                      || Ogr_ftype == OFTInteger64
+#endif
+		      )) {
                     G_fatal_error(_("Key column '%s' is not integer"), param.key->answer);
                 }
                 key_column = G_store(OGR_Fld_GetNameRef(Ogr_field));
@@ -1282,7 +1286,11 @@ int main(int argc, char *argv[])
 		    }
 		    else {
 			/* G_warning (_("Column value not set" )); */
-			if (Ogr_ftype == OFTInteger || Ogr_ftype == OFTInteger64 ||Ogr_ftype == OFTReal) {
+			if (Ogr_ftype == OFTInteger ||
+#if GDAL_VERSION_NUM >= 2000000
+                            Ogr_ftype == OFTInteger64 ||
+#endif
+                            Ogr_ftype == OFTReal) {
 			    sprintf(buf, ", NULL");
 			}
 #if GDAL_VERSION_NUM >= 1320