newlib 2.5 added the locale management functions, and so our stub __nop_locale_mgmt.h shouldn't be included, as it conflicts with newlibs definitions. newlib 2.4 and earlier still need the header though.
Patch by Martin J. O'Riordan
Differential D32146
PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+ waltl on Apr 17 2017, 6:21 PM. Authored by
Details newlib 2.5 added the locale management functions, and so our stub __nop_locale_mgmt.h shouldn't be included, as it conflicts with newlibs definitions. newlib 2.4 and earlier still need the header though. Patch by Martin J. O'Riordan
Diff Detail
Event Timeline
Comment Actions 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 Comment Actions PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+ Newlib 2.5 added the locale management functions, so it should not For newlib 2.4, some releases contain these functions and some don't, I've tested this against newlib 2.2 and 2.5, and also sanity check Comment Actions This change looks fine to me - but I don't have the different newlib versions to test against. Comment Actions Looks good. Previously I had also got a check for 'defined(__NEWLIB_MINOR__)' but I realise that was not necessary |