[geos-devel] Splitting _r and non _r functions in 2 different .h ?
Even Rouault
even.rouault at mines-paris.org
Wed Jun 18 03:24:48 PDT 2014
Le mardi 17 juin 2014 23:07:52, Even Rouault a écrit :
> Hi,
>
> Currently it is difficult to ensure that ones code only uses the _r C API.
> I would propose to put the 2 kind of API into 2 separate files.
>
> geos_c_r.h would contain the _r C API only, and the few requirements
> (typedefs, etc...) self sufficient so that libraries/applications using
> GEOS might just include geos_c_r.h.
>
> geos_c.h would include geos_c_r.h, for backward compatibility.
>
> If that sounds good, I'll propose a patch for that.
Thinking more about this, for the sake of simplicity of user code of GEOS, I'd
rather suggest
geos.c.h:
#ifndef USE_ONLY_GEOS_R_API
Here go normal declarations (non XXXXX_r symbols)
#endif
Here go declarations of XXXXX_r symbols
end of file
So user code would do
#define USE_ONLY_GEOS_R_API
#include <geos_c.h>
That way it would work with both newer GEOS versions and older ones without
trying to figure out which GEOS version is included. Which requires including
geos_c.h ....
>
> Even
--
Geospatial professional services
http://even.rouault.free.fr/services.html
More information about the geos-devel
mailing list