On jeudi 21 décembre 2017 05:45:02 CET Kurt Schwehr wrote:
> In Even's https://trac.osgeo.org/gdal/changeset/41094:
> Even handles the multiple definitions of OGRRegisterAll(). I propose that
> we remove the one from ogrsf_frmts.h ( which was not my first thought ). I
> think the common cases are:
> 1) you just want all the drivers registered and don't care about individual
> registers, so just use ogr_api.h. You will likely need it anyway.
> 2) you are definiting a register function and don't care
> about OGRRegisterAll so include ogrsf_frmts.h
> 3) you want a specific driver registered and don't care
> Cases 2 and 3 likely will have to include ogr_api.h to do their work, but
> maybe not in a rare case.
> Why add extra in case 1?
People only using the C++ API might just need to include ogrsf_frmts.h currently.
But actually looking at inclusiong chain:
ogrsf_frmts.h includes gdal_priv.h
gdal_priv.h includes gdal.h
gdal.h includes ogr_api.h
So I've just committed the redefinition in ogrsf_frmts.h
Spatialys - Geospatial professional services