[PATCH] D31970: [libcxx] Direct support for Fuchsia

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 20:50:30 PDT 2017


phosek created this revision.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D31970

Files:
  include/__config
  include/__locale
  include/support/fuchsia/xlocale.h


Index: include/support/fuchsia/xlocale.h
===================================================================
--- /dev/null
+++ include/support/fuchsia/xlocale.h
@@ -0,0 +1,22 @@
+// -*- 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/__strtonum_fallback.h>
+
+#endif // defined(__Fuchsia__)
+
+#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
Index: include/__locale
===================================================================
--- include/__locale
+++ include/__locale
@@ -37,6 +37,8 @@
 #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__
Index: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -1013,7 +1013,7 @@
 #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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31970.94933.patch
Type: text/x-patch
Size: 1789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170412/129a062b/attachment.bin>


More information about the llvm-commits mailing list