[GRASS-SVN] r71762 - grass/branches/releasebranch_7_4/include/defs

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 18 01:27:03 PST 2017


Author: mmetz
Date: 2017-11-18 01:27:03 -0800 (Sat, 18 Nov 2017)
New Revision: 71762

Modified:
   grass/branches/releasebranch_7_4/include/defs/gis.h
Log:
libgis: add GDAL patch in one central place instead of in 8 modules and 3 libraries separately (backport trunk r71754)

Modified: grass/branches/releasebranch_7_4/include/defs/gis.h
===================================================================
--- grass/branches/releasebranch_7_4/include/defs/gis.h	2017-11-18 08:59:58 UTC (rev 71761)
+++ grass/branches/releasebranch_7_4/include/defs/gis.h	2017-11-18 09:27:03 UTC (rev 71762)
@@ -72,6 +72,25 @@
 #define RELDIR "?"
 #endif
 
+/* GDAL < 2.3 does not define HAVE_LONG_LONG when compiled with 
+ * Visual Studio as for OSGeo4W, even though long long is available,
+ * and GIntBig falls back to long which is on Windows always 4 bytes.
+ * This patch ensures that GIntBig is defined as long long (8 bytes)
+ * if GDAL is compiled with Visual Studio and GRASS is compiled with 
+ * MinGW. This patch must be applied before other GDAL/OGR headers are
+ * included, as done by gprojects.h and vector.h */
+#if defined(__MINGW32__) && HAVE_GDAL
+# include <gdal_version.h>
+# if GDAL_VERSION_NUM < 2030000
+#  include <cpl_config.h>
+   /* HAVE_LONG_LONG_INT comes from GRASS
+    * HAVE_LONG_LONG comes from GDAL */
+#  if HAVE_LONG_LONG_INT && !defined(HAVE_LONG_LONG)
+#   define HAVE_LONG_LONG 1
+#  endif
+# endif
+#endif
+
 /* adj_cellhd.c */
 void G_adjust_Cell_head(struct Cell_head *, int, int);
 void G_adjust_Cell_head3(struct Cell_head *, int, int, int);



More information about the grass-commit mailing list