[gdal-dev] Propose removing OGRRegisterAll(void); in ogrsf_frmts.h

Even Rouault even.rouault at spatialys.com
Thu Dec 21 06:08:30 PST 2017


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
> about OGRRegisterAll so include ogrsf_frmts.h
> 
> 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

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171221/28e3a061/attachment-0001.html>


More information about the gdal-dev mailing list