summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-04-13 21:29:21 +0000
committerPetr Hosek <phosek@chromium.org>2017-04-13 21:29:21 +0000
commitd0e9481c55e1edca268a240359d3acc4c2a212fa (patch)
tree321e2a8a253c55ec5fdee3194b400bfbbb9dc7a0 /libcxx
parentf571409a02c847ca8cecb0d44afaf2b79f2ca002 (diff)
downloadbcm5719-llvm-d0e9481c55e1edca268a240359d3acc4c2a212fa.tar.gz
bcm5719-llvm-d0e9481c55e1edca268a240359d3acc4c2a212fa.zip
[libcxx] Direct support for Fuchsia
Fuchsia's libc was forked from musl, but has evolved sufficiently since then so it no longer makes sense to pretend it's musl. This change implements direct support for Fuchsia rather than piggybacking on musl support. Differential Revision: https://reviews.llvm.org/D31970 llvm-svn: 300261
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/__config2
-rw-r--r--libcxx/include/__locale4
-rw-r--r--libcxx/include/support/fuchsia/xlocale.h23
3 files changed, 27 insertions, 2 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index bca85b6e381..ee46860495a 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1027,7 +1027,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#endif
#if defined(__BIONIC__) || defined(__CloudABI__) || \
- defined(_LIBCPP_HAS_MUSL_LIBC)
+ defined(__Fuchsia__) || defined(_LIBCPP_HAS_MUSL_LIBC)
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
#endif
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index a878e259b80..918cd1df5c6 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -37,9 +37,11 @@
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
# include <xlocale.h>
+#elif defined(__Fuchsia__)
+# include <support/fuchsia/xlocale.h>
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
# include <support/musl/xlocale.h>
-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
diff --git a/libcxx/include/support/fuchsia/xlocale.h b/libcxx/include/support/fuchsia/xlocale.h
new file mode 100644
index 00000000000..1de2fca28e2
--- /dev/null
+++ b/libcxx/include/support/fuchsia/xlocale.h
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+//===------------------- support/fuchsia/xlocale.h ------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+
+#if defined(__Fuchsia__)
+
+#include <cstdlib>
+#include <cwchar>
+#include <support/xlocale/__posix_l_fallback.h>
+#include <support/xlocale/__strtonum_fallback.h>
+
+#endif // defined(__Fuchsia__)
+
+#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
OpenPOWER on IntegriCloud