[PATCH] D32146: PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+

Martin O'Riordan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 19 07:18:58 PDT 2017


MartinO added a comment.

The introduction of the macros '__NEWLIB__' and '__NEWLIB_MINOR__' appear to have been first introduced in Newlib v2.3.0.20160226, but the new interface for '<locale.h>' was introduced in Newlib v2.4.0.20160923 - previous releases of v2.4.0 did not make these changes.

This is why the tests 'defined(__NEWLIB__)' and 'defined(__NEWLIB_MINOR__)' are also necessary.

Unfortunately, I don't know of anyway of telling if Newlib v2.4.0 is the 20160923 version or an earlier version such as the original v2.4.0 release or the 20160527 version which was the last version of Newlib that used the old interface. There is no macro that provides this information and '__NEWLIB_PATCHLEVEL__' is always '0' for each is these intermediate versions (I don't know why they don't bump the patch number).

I've no comment about whether or not the '__POSIX_VISIBLE' test is required, it was already present and I simply supplemented it with the Newlib version checks.

  MartinO


https://reviews.llvm.org/D32146





More information about the cfe-commits mailing list