[GRASS-SVN] r71754 - grass/trunk/include/defs

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 17 00:54:35 PST 2017


Author: mmetz
Date: 2017-11-17 00:54:35 -0800 (Fri, 17 Nov 2017)
New Revision: 71754

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

Modified: grass/trunk/include/defs/gis.h
===================================================================
--- grass/trunk/include/defs/gis.h	2017-11-17 06:53:19 UTC (rev 71753)
+++ grass/trunk/include/defs/gis.h	2017-11-17 08:54:35 UTC (rev 71754)
@@ -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