summaryrefslogtreecommitdiff
path: root/include/support
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2017-06-14 16:40:03 +0000
committerJames Y Knight <jyknight@google.com>2017-06-14 16:40:03 +0000
commit13498f6888cf14b33383e29db42df4f7eb549e6e (patch)
tree654759961e3dd310b1b0b0bad50eb8f7eca0320c /include/support
parenteaa74739c0d038d3c1fd9b449e4589f9f9cf78ff (diff)
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
Diffstat (limited to 'include/support')
-rw-r--r--include/support/newlib/xlocale.h3
1 files changed, 3 insertions, 0 deletions
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 <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>