From b6567b18c72b3a4370002d689fda50eeee827d5b 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 llvm-svn: 305394 --- libcxx/include/support/newlib/xlocale.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcxx/include/support/newlib/xlocale.h b/libcxx/include/support/newlib/xlocale.h index 4e4b23be8d6b..4b7e9b7495a0 100644 --- a/libcxx/include/support/newlib/xlocale.h +++ b/libcxx/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