[libcxx-commits] [PATCH] D88718: [libcxx] Port to NuttX(https://nuttx.apache.org/) RTOS

Xiang Xiao via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 1 22:38:53 PDT 2020


xiaoxiang781216 updated this revision to Diff 295736.
xiaoxiang781216 added a comment.

Updating D88718 <https://reviews.llvm.org/D88718>: [libcxx] Port to NuttX(https://nuttx.apache.org/) RTOS


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88718/new/

https://reviews.llvm.org/D88718

Files:
  libcxx/include/__config
  libcxx/include/__locale
  libcxx/include/support/nuttx/xlocale.h
  libcxx/src/include/config_elast.h
  libcxx/src/locale.cpp


Index: libcxx/src/locale.cpp
===================================================================
--- libcxx/src/locale.cpp
+++ libcxx/src/locale.cpp
@@ -30,7 +30,7 @@
 #include "__sso_allocator"
 #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
 #include "support/win32/locale_win32.h"
-#elif !defined(__BIONIC__)
+#elif !defined(__BIONIC__) && !defined(__NuttX__)
 #include <langinfo.h>
 #endif
 #include <stdlib.h>
Index: libcxx/src/include/config_elast.h
===================================================================
--- libcxx/src/include/config_elast.h
+++ libcxx/src/include/config_elast.h
@@ -19,7 +19,7 @@
 
 #if defined(ELAST)
 #define _LIBCPP_ELAST ELAST
-#elif defined(_NEWLIB_VERSION)
+#elif defined(__NuttX__) || defined(_NEWLIB_VERSION)
 #define _LIBCPP_ELAST __ELASTERROR
 #elif defined(__Fuchsia__)
 // No _LIBCPP_ELAST needed on Fuchsia
Index: libcxx/include/support/nuttx/xlocale.h
===================================================================
--- /dev/null
+++ libcxx/include/support/nuttx/xlocale.h
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//===-------------------- support/nuttx/xlocale.h -------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
+#define _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
+
+#if defined(__NuttX__)
+#include <support/xlocale/__posix_l_fallback.h>
+#include <support/xlocale/__strtonum_fallback.h>
+
+#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
+
+#undef __linux__
+#undef __unix__
+#undef __APPLE__
+#undef __GLIBC__
+#undef _NEWLIB_VERSION
+
+#endif // __NuttX__
+
+#endif
Index: libcxx/include/__locale
===================================================================
--- libcxx/include/__locale
+++ libcxx/include/__locale
@@ -21,6 +21,8 @@
 #if defined(_LIBCPP_MSVCRT_LIKE)
 # include <cstring>
 # include <support/win32/locale_win32.h>
+#elif defined(__NuttX__)
+# include <support/nuttx/xlocale.h>
 #elif defined(_AIX)
 # include <support/ibm/xlocale.h>
 #elif defined(__ANDROID__)
Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -1124,6 +1124,7 @@
 #  if defined(__FreeBSD__) || \
       defined(__wasi__) || \
       defined(__NetBSD__) || \
+      defined(__NuttX__) || \
       defined(__linux__) || \
       defined(__GNU__) || \
       defined(__APPLE__) || \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88718.295736.patch
Type: text/x-patch
Size: 2640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201002/6811d929/attachment.bin>


More information about the libcxx-commits mailing list