mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Fix a few wide character build issues
This commit is contained in:
@@ -37,7 +37,7 @@ ifeq ($(CONFIG_LIBC_LOCALE),y)
|
||||
|
||||
# Add the locale files to the build
|
||||
|
||||
CSRCS += lib_setlocale.c
|
||||
CSRCS += lib_setlocale.c lib_localeconv.c
|
||||
|
||||
# Add the locale directory to the build
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lconv *localeconv(void);
|
||||
FAR struct lconv *localeconv(void)
|
||||
{
|
||||
/* NULL indicates the the locale was not changed */
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ ifeq ($(CONFIG_FS_WRITABLE),y)
|
||||
CSRCS += lib_mktemp.c lib_mkstemp.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBC_WCHAR),y)
|
||||
CSRCS += lib_mbtowc.c lib_wctomb.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PSEUDOTERM_SUSV1),y)
|
||||
CSRCS += lib_ptsname.c lib_ptsnamer.c
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/wchar/lib_mbtowc.c
|
||||
* libc/stdlib/lib_mbtowc.c
|
||||
*
|
||||
* Copyright (c)1999 Citrus Project,
|
||||
* All rights reserved.
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/wchar/lib_wctomb.c
|
||||
* libc/stdlib/lib_wctomb.c
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Chris Torek.
|
||||
@@ -35,9 +35,10 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef CONFIG_LIBC_WCHAR
|
||||
@@ -38,9 +38,8 @@ ifeq ($(CONFIG_LIBC_WCHAR),y)
|
||||
# Add the internal C files to the build
|
||||
|
||||
CSRCS += lib_wcscmp.c lib_wcslen.c lib_wmemchr.c lib_wmemcmp.c lib_wmemcpy.c
|
||||
CSRCS += lib_wmemmove.c lib_wmemset.c lib_mbtowc.c lib_btowc.c lib_mbrtowc.c
|
||||
CSRCS += lib_wctomb.c lib_wctob.c lib_wcslcpy.c lib_wcsxfrm.c lib_wctype.c
|
||||
CSRCS += lib_wcrtomb.c
|
||||
CSRCS += lib_wmemmove.c lib_wmemset.c lib_btowc.c lib_mbrtowc.c lib_wctob.c
|
||||
CSRCS +=lib_wcslcpy.c lib_wcsxfrm.c lib_wcrtomb.c
|
||||
|
||||
# Add the wchar directory to the build
|
||||
|
||||
|
||||
@@ -33,10 +33,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#ifdef CONFIG_LIBC_WCHAR
|
||||
|
||||
@@ -54,18 +55,18 @@
|
||||
|
||||
wint_t btowc(int c)
|
||||
{
|
||||
int retval = 0;
|
||||
wchar_t pwc;
|
||||
unsigned char b;
|
||||
char b;
|
||||
int retval = 0;
|
||||
|
||||
if (c == EOF)
|
||||
{
|
||||
return WEOF;
|
||||
}
|
||||
|
||||
b = (unsigned char)c;
|
||||
b = (char)c;
|
||||
|
||||
retval = mbtowc(&pwc, &b, 1);
|
||||
retval = mbtowc(&pwc, (FAR const char *)&b, 1);
|
||||
|
||||
if (retval != 0 && retval != 1)
|
||||
{
|
||||
|
||||
@@ -33,11 +33,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#ifdef CONFIG_LIBC_WCHAR
|
||||
|
||||
@@ -68,11 +69,11 @@ size_t mbrtowc(FAR wchar_t *pwc, FAR const char *s, size_t n, mbstate_t *ps)
|
||||
|
||||
if (retval == -1)
|
||||
{
|
||||
return (size_t) (-1);
|
||||
return (size_t)(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (size_t) retval;
|
||||
return (size_t)retval;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
@@ -35,9 +35,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef CONFIG_LIBC_WCHAR
|
||||
|
||||
Reference in New Issue
Block a user