[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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1027,7 +1027,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__BIONIC__) || defined(__CloudABI__) || \
|
#if defined(__BIONIC__) || defined(__CloudABI__) || \
|
||||||
defined(_LIBCPP_HAS_MUSL_LIBC)
|
defined(__Fuchsia__) || defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||||
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
|
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -37,9 +37,11 @@
|
|||||||
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|
||||||
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
|
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
|
||||||
# include <xlocale.h>
|
# include <xlocale.h>
|
||||||
|
#elif defined(__Fuchsia__)
|
||||||
|
# include <support/fuchsia/xlocale.h>
|
||||||
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
|
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||||
# include <support/musl/xlocale.h>
|
# include <support/musl/xlocale.h>
|
||||||
#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
#endif
|
||||||
|
|
||||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|||||||
23
include/support/fuchsia/xlocale.h
Normal file
23
include/support/fuchsia/xlocale.h
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user