Javier,

could you rename GDAL_HAVE_XLOCALE_H to HAVE_XLOCALE_H, at the minimum in the places where it is used in https://github.com/OSGeo/gdal/commit/d83a9f58acb and https://github.com/OSGeo/gdal/commit/ab9386760f60e6a312d8418737b5fd94dd7adccb. (I don't think it must be used elsewhere)

As far as I remember the reason for the GDAL_ prefix was to avoid "contamination" for other software that use cpl_config.h, but since then I've restructured that file so that most of it is only defined when building GDAL, and not when including GDAL, so that GDAL_ prefix is no longer useful

Even

Le 06/04/2022 à 18:38, Javier Jimenez Shaw a écrit :
Hi

I have seen these two macros defined in the code, and maybe there is a conflict.

in "cmake/template/cpl_config.h.in <http://cpl_config.h.in>" it says
/* Define to 1 if you have the <xlocale.h> header file. */
#cmakedefine GDAL_HAVE_XLOCALE_H 1

and "cmake/helpers/configure.cmake"
check_include_file("xlocale.h" GDAL_HAVE_XLOCALE_H)

but in "ogr/ogrsf_frmts/geojson/libjson/json_tokener.c" says
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif

(that is failing in my M1 compilation)

Should it be
#if defined(HAVE_XLOCALE_H) || defined(GDAL_HAVE_XLOCALE_H)
or directly
#ifdef GDAL_HAVE_XLOCALE_H
or something else?

I can do such a PR.

BTW, there are multiple "HAVE_*" macros, why is this one "GDAL_HAVE_*"?

Thanks.
.___ ._ ..._ .. . ._. .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.


_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to