You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/07/30 12:43:32 UTC

[incubator-nuttx] branch master updated (b64e905 -> 3c400f3)

This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from b64e905  mm: Fix a typo in Kconfig
     new decf7d0  locale: Add LC_GLOBAL_LOCALE which is specified by the standard
     new cdc781b  libc: Implement local_t related functions
     new 3c400f3  Remove the locale fallback from libcxx

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 include/ctype.h                                    | 20 ++++++++
 include/locale.h                                   |  2 +
 include/stdlib.h                                   |  6 +++
 include/string.h                                   |  8 ++++
 include/strings.h                                  |  3 ++
 include/time.h                                     |  5 +-
 include/wchar.h                                    |  8 ++++
 include/wctype.h                                   | 19 ++++++++
 ...0001-Remove-the-locale-fallback-for-NuttX.patch | 55 ++++++++++++++++++++++
 libs/libxx/libcxx.defs                             |  1 +
 10 files changed, 125 insertions(+), 2 deletions(-)
 create mode 100644 libs/libxx/0001-Remove-the-locale-fallback-for-NuttX.patch

[incubator-nuttx] 01/03: locale: Add LC_GLOBAL_LOCALE which is specified by the standard

Posted by gu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit decf7d0ad9719948eacc0a845f37463dd1afa49b
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Jul 28 14:28:34 2021 +0800

    locale: Add LC_GLOBAL_LOCALE which is specified by the standard
    
    https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/locale.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/locale.h b/include/locale.h
index 591f064..2abef76 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -51,6 +51,8 @@
                           LC_MONETARY_MASK | LC_NUMERIC_MASK | \
                           LC_TIME_MASK     | LC_MESSAGES_MASK)
 
+#define LC_GLOBAL_LOCALE ((locale_t)-1)
+
 /****************************************************************************
  * Public Type Definitions
  ****************************************************************************/

[incubator-nuttx] 03/03: Remove the locale fallback from libcxx

Posted by gu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 3c400f32fa257ea2856a6d87c054e9de09097436
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Jul 30 18:40:42 2021 +0800

    Remove the locale fallback from libcxx
    
    since these functions can handled by NuttX's libc now
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 ...0001-Remove-the-locale-fallback-for-NuttX.patch | 55 ++++++++++++++++++++++
 libs/libxx/libcxx.defs                             |  1 +
 2 files changed, 56 insertions(+)

diff --git a/libs/libxx/0001-Remove-the-locale-fallback-for-NuttX.patch b/libs/libxx/0001-Remove-the-locale-fallback-for-NuttX.patch
new file mode 100644
index 0000000..5c90c1f
--- /dev/null
+++ b/libs/libxx/0001-Remove-the-locale-fallback-for-NuttX.patch
@@ -0,0 +1,55 @@
+From fdc60516f58633382ae5d73256a99c7737b174e5 Mon Sep 17 00:00:00 2001
+From: Xiang Xiao <xi...@xiaomi.com>
+Date: Fri, 30 Jul 2021 17:24:51 +0800
+Subject: [PATCH] Remove the locale fallback for NuttX
+
+since these functions can handled by NuttX's libc now
+
+Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
+Change-Id: I68c9f6a690313748e030510d391170d8ca83ee7d
+---
+ include/__locale                  |  2 --
+ include/__support/nuttx/xlocale.h | 18 ------------------
+ 2 files changed, 20 deletions(-)
+ delete mode 100644 include/__support/nuttx/xlocale.h
+
+diff --git libcxx/include/__locale libcxx/include/__locale
+index 77e5faab2..054973e9f 100644
+--- libcxx/include/__locale
++++ libcxx/include/__locale
+@@ -22,8 +22,6 @@
+ #if defined(_LIBCPP_MSVCRT_LIKE)
+ # include <cstring>
+ # include <__support/win32/locale_win32.h>
+-#elif defined(__NuttX__)
+-# include <__support/nuttx/xlocale.h>
+ #elif defined(_AIX) || defined(__MVS__)
+ # include <__support/ibm/xlocale.h>
+ #elif defined(__ANDROID__)
+diff --git libcxx/include/__support/nuttx/xlocale.h libcxx/include/__support/nuttx/xlocale.h
+deleted file mode 100644
+index be738e3b6..000000000
+--- libcxx/include/__support/nuttx/xlocale.h
++++ /dev/null
+@@ -1,18 +0,0 @@
+-// -*- C++ -*-
+-//===-----------------------------------------------------------------------===//
+-//
+-// 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>
+-#endif // __NuttX__
+-
+-#endif
+-- 
+2.17.1
+
diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs
index 8540972..c0c6fda 100644
--- a/libs/libxx/libcxx.defs
+++ b/libs/libxx/libcxx.defs
@@ -27,6 +27,7 @@ libcxx: libcxx-$(VERSION).src.tar.xz
 	$(Q) tar -xf libcxx-$(VERSION).src.tar.xz \
 	         --exclude libcxx-$(VERSION).src/test/std/pstl
 	$(Q) mv libcxx-$(VERSION).src libcxx
+	$(Q) patch -p0 < 0001-Remove-the-locale-fallback-for-NuttX.patch
 	$(Q) touch $@
 
 $(TOPDIR)/include/libcxx: libcxx

[incubator-nuttx] 02/03: libc: Implement local_t related functions

Posted by gu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit cdc781bdfd261e20b3840a763e1322a2f4ef1cdc
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Jul 28 22:44:44 2021 +0800

    libc: Implement local_t related functions
    
    since local_t isn't really implemented on NuttX,
    we can simply redirect to the non-locale version.
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/ctype.h   | 20 ++++++++++++++++++++
 include/stdlib.h  |  6 ++++++
 include/string.h  |  8 ++++++++
 include/strings.h |  3 +++
 include/time.h    |  5 +++--
 include/wchar.h   |  8 ++++++++
 include/wctype.h  | 19 +++++++++++++++++++
 7 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/include/ctype.h b/include/ctype.h
index c24c026..9b9463f 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -33,6 +33,26 @@
 #include <nuttx/compiler.h>
 
 /****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define isalnum_l(c, l)  isalnum(c)
+#define isalpha_l(c, l)  isalpha(c)
+#define isascii_l(c, l)  isascii(c)
+#define isblank_l(c, l)  isblank(c)
+#define iscntrl_l(c, l)  iscntrl(c)
+#define isdigit_l(c, l)  isdigit(c)
+#define isgraph_l(c, l)  isgraph(c)
+#define islower_l(c, l)  islower(c)
+#define isprint_l(c, l)  isprint(c)
+#define ispunct_l(c, l)  ispunct(c)
+#define isspace_l(c, l)  isspace(c)
+#define isupper_l(c, l)  isupper(c)
+#define isxdigit_l(c, l) isxdigit(c)
+#define tolower_l(c, l)  tolower(c)
+#define toupper_l(c, l)  toupper(c)
+
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
diff --git a/include/stdlib.h b/include/stdlib.h
index 690b294..93ac5fd 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -66,6 +66,12 @@
 #  define environ get_environ_ptr()
 #endif
 
+#define strtof_l(s, e, l)      strtof(s, e)
+#define strtod_l(s, e, l)      strtod(s, e)
+#define strtold_l(s, e, l)     strtold(s, e)
+#define strtoll_l(s, e, b, l)  strtoll(s, e, b)
+#define strtoull_l(s, e, b, l) strtoull(s, e, b)
+
 /****************************************************************************
  * Public Type Definitions
  ****************************************************************************/
diff --git a/include/string.h b/include/string.h
index d90e112..ef331bd 100644
--- a/include/string.h
+++ b/include/string.h
@@ -36,6 +36,14 @@
 #include <nuttx/b2c.h>
 
 /****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define strcoll_l(s1, s2, l)    strcoll(s1, s2)
+#define strerror_l(e, l)        strerror(e)
+#define strxfrm_l(s1, s2, n, l) strxfrm(s1, s2, n)
+
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/include/strings.h b/include/strings.h
index 2ceba61..f0c216d 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -53,6 +53,9 @@
 #define bzero(s,n)       (void)memset(s,0,n)
 #endif
 
+#define strcasecmp_l(s1, s2, l)     strcasecmp(s1, s2)
+#define strncasecmp_l(s1, s2, n, l) strncasecmp(s1, s2, n)
+
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/include/time.h b/include/time.h
index 6bca579..8f045e3 100644
--- a/include/time.h
+++ b/include/time.h
@@ -91,9 +91,10 @@
 
 #define TIME_UTC           1
 
-/* Redirect the timelocal */
+/* Redirect the timelocal and strftime_l */
 
-#define timelocal         mktime
+#define timelocal                 mktime
+#define strftime_l(s, m, f, t, l) strftime(s, m, f, t)
 
 /********************************************************************************
  * Public Types
diff --git a/include/wchar.h b/include/wchar.h
index 8883414..805d4de 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -65,6 +65,14 @@
 #  define NULL ((FAR void *)0)
 #endif
 
+#define wcsftime_l(s, m, f, t, l)   wcsftime(s, m, f, t)
+#define wcscasecmp_l(s1, s2, l)     wcscasecmp(s1, s2)
+#define wcsncasecmp_l(s1, s2, n, l) wcsncasecmp(s1, s2, n)
+#define wcscoll_l(s1, s2, l)        wcscoll(s1, s2)
+#define wcstold_l(s, e, l)          wcstold(s, e)
+#define wcstoull_l(s, e, l)         wcstoull(s, e)
+#define wcsxfrm_l(s1, s2, n, l)     wcsxfrm(s1, s2, n)
+
 /****************************************************************************
  * Type Definitions
  ****************************************************************************/
diff --git a/include/wctype.h b/include/wctype.h
index ec619cd..6336292 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -52,6 +52,25 @@
 #define WC_UPPER        11
 #define WC_XDIGIT       12
 
+#define iswalnum_l(c, l)     iswalnum(c)
+#define iswalpha_l(c, l)     iswalpha(c)
+#define iswblank_l(c, l)     iswblank(c)
+#define iswcntrl_l(c, l)     iswcntrl(c)
+#define iswdigit_l(c, l)     iswdigit(c)
+#define iswgraph_l(c, l)     iswgraph(c)
+#define iswlower_l(c, l)     iswlower(c)
+#define iswprint_l(c, l)     iswprint(c)
+#define iswpunct_l(c, l)     iswpunct(c)
+#define iswspace_l(c, l)     iswspace(c)
+#define iswupper_l(c, l)     iswupper(c)
+#define iswxdigit_l(c, l)    iswxdigit(c)
+#define iswctype_l(c, d, l)  iswctype(c, d)
+#define towlower_l(c, l)     towlower(c)
+#define towupper_l(c, l)     towupper(c)
+#define towctrans_l(c, d, l) towctrans(c, d)
+#define wctrans_l(p, l)      wctrans(p)
+#define wctype_l(p, l)       wctype(p)
+
 /****************************************************************************
  * Public Types
  ****************************************************************************/