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

Walter Lee via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 12 17:10:41 PDT 2017


waltl updated this revision to Diff 102265.
waltl added a comment.

PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+

Newlib 2.5 added the locale management functions, so it should not
include __nop_local_mgmt.h.  This change adds proper guard around that
include statement.

For newlib 2.4, some releases contain these functions and some don't,
and they all have the same version numbers.  This patch will work
properly with the initial "2.4.0" release which does not include these
functions and require __nop_local_mgmt.h.

I've tested this against newlib 2.2 and 2.5, and also sanity check
against other different version numbers.


https://reviews.llvm.org/D32146

Files:
  include/support/newlib/xlocale.h


Index: include/support/newlib/xlocale.h
===================================================================
--- include/support/newlib/xlocale.h
+++ include/support/newlib/xlocale.h
@@ -16,7 +16,10 @@
 #include <clocale>
 #include <cwctype>
 #include <ctype.h>
+#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
+    __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
 #include <support/xlocale/__nop_locale_mgmt.h>
+#endif
 #include <support/xlocale/__posix_l_fallback.h>
 #include <support/xlocale/__strtonum_fallback.h>
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32146.102265.patch
Type: text/x-patch
Size: 512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170613/103d537f/attachment.bin>


More information about the cfe-commits mailing list