From 13498f6888cf14b33383e29db42df4f7eb549e6e Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Wed, 14 Jun 2017 16:40:03 +0000 Subject: [PATCH] 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. This has been tested against newlib 2.2 and 2.5, and also sanity checks against other different version numbers. Patch by Martin J. O'Riordan and Walter Lee Differential Revision: https://reviews.llvm.org/D32146 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305394 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/support/newlib/xlocale.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/support/newlib/xlocale.h b/include/support/newlib/xlocale.h index 4e4b23be8..4b7e9b749 100644 --- a/include/support/newlib/xlocale.h +++ b/include/support/newlib/xlocale.h @@ -16,7 +16,10 @@ #include #include #include +#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \ + __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5 #include +#endif #include #include