Avoid runtime locale switching (CPLLocaleC usage)
|Reported by:||dron||Owned by:||warmerdam|
r21801 as well as r21785 and r21784 introduces multiple runtime locale switches in GDAL. That is generally bad idea, because POSIX locale is a process property, so it is not thread safe and performance overhead is also remains unclear. Note, that if the main process opens several GDAL datasets in separate threads setlocale() call changes behavior of the whole process including the possible separate thread that interacts with user.
There is a CPLAtof() helper that should solve the problem of parsing numeric values. Is it possible to go with CPLAtof() not touching locale at all?
The second problem is that GDAL now can't be built with an external libgeotiff because of r21801, the CPLLocaleC is unavailable. It's declaration should be moved into the gt_wkt_srs.cpp in the block, surrounded by CPL_SERV_H_INTERNAL guards.