<div dir="ltr"><div><div><br><br>On Sat, Nov 11, 2017 at 7:45 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br>><br>>  <br>><br>> > If GDALSetCacheMax64 must evaluate to GDALSetCacheMax64 ( int ),<br>><br>>  <br>><br>> My hypothesis might be wrong, but if it is true, then it *wrongly* evaluates to GDALSetCacheMax64 ( int ) when currently called by GRASS. If you define HAVE_LONG_LONG before including cpl_port.h or any other GDAL include files, that should work fine.<br><br></div>Stupid question: such a #define has only effect on compile time. If GDAL has been compiled without HAVE_LONG_LONG being defined, and then we define HAVE_LONG_LONG when compiling against GDAL, is this creating a big mess? GRASS might then use a different GIntBig than GDAL.<br><br></div>Markus M<br><br><div><div><div>><br>> Similar issue, or more subtle ones, could also arise with other GDAL/OGR functions that use GIntBig (*). I guess the issue is only detected with GDALSetCacheMax64 since it uses CPL_STDCALL convention which apparently embeds the argument size in the symbol name, whereas C decl doesn't do it.<br>><br>>  <br>><br>> I'm not sure why this would only occur with 32 bit builds, though. But this situation of using cpl_config.h generated for MSVC is kind of dangerous<br>><br>>  <br>><br>> Even<br>><br>>  <br>><br>> (*)<br>><br>>  <br>><br>> $ grep GIntBig ogr/ogr_api*.h<br>><br>> GIntBig CPL_DLL OGR_F_GetFieldAsInteger64( OGRFeatureH, int );<br>><br>> const GIntBig CPL_DLL *OGR_F_GetFieldAsInteger64List( OGRFeatureH, int, int * );<br>><br>> void CPL_DLL OGR_F_SetFieldInteger64( OGRFeatureH, int, GIntBig );<br>><br>> void CPL_DLL OGR_F_SetFieldInteger64List( OGRFeatureH, int, int, const GIntBig * );<br>><br>> GIntBig CPL_DLL OGR_F_GetFID( OGRFeatureH );<br>><br>> OGRErr CPL_DLL OGR_F_SetFID( OGRFeatureH, GIntBig );<br>><br>> OGRErr CPL_DLL OGR_L_SetNextByIndex( OGRLayerH, GIntBig );<br>><br>> OGRFeatureH CPL_DLL OGR_L_GetFeature( OGRLayerH, GIntBig ) CPL_WARN_UNUSED_RESULT;<br>><br>> OGRErr CPL_DLL OGR_L_DeleteFeature( OGRLayerH, GIntBig ) CPL_WARN_UNUSED_RESULT;<br>><br>> GIntBig CPL_DLL OGR_L_GetFeatureCount( OGRLayerH, int );<br>><br>> GIntBig CPL_DLL OGR_L_GetFeaturesRead( OGRLayerH );<br>><br>>  <br>><br>>  <br>><br>>  <br>><br>> --<br>><br>> Spatialys - Geospatial professional services<br>><br>> <a href="http://www.spatialys.com">http://www.spatialys.com</a><br><br></div></div></div></div>