mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Fix a few wide character build issues
This commit is contained in:
@@ -42,8 +42,10 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <wchar.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -202,6 +204,13 @@ double_t strtod(FAR const char *str, FAR char **endptr);
|
||||
|
||||
FAR char *itoa(int val, FAR char *str, int base);
|
||||
|
||||
/* Wide character operations */
|
||||
|
||||
#ifdef CONFIG_LIBC_WCHAR
|
||||
int mbtowc(FAR wchar_t *pwc, FAR const char *s, size_t n);
|
||||
int wctomb(FAR char *s, wchar_t wchar);
|
||||
#endif
|
||||
|
||||
/* Memory Management */
|
||||
|
||||
FAR void *malloc(size_t);
|
||||
|
||||
+10
-5
@@ -33,9 +33,6 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_WCHAR_H
|
||||
#define __INCLUDE_WCHAR_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
@@ -50,6 +47,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* REVISIT: Moving the idempotence to this location resolves a circular
|
||||
* dependency problem with stdlib.h which gets included indirectory and
|
||||
* needs wchar_t.
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE_WCHAR_H
|
||||
#define __INCLUDE_WCHAR_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -105,7 +110,6 @@ typedef int wint_t;
|
||||
* state, the results are unspecified.
|
||||
*/
|
||||
|
||||
#if 0 /* Not used */
|
||||
/* Commented out because this is dangerous. This defines a type that would
|
||||
* be internal to some wchar implementation. NuttX does not implement the
|
||||
* wchar functions. Having this definition is a time bomb: If this header
|
||||
@@ -127,7 +131,6 @@ struct mbstate_s
|
||||
};
|
||||
|
||||
typedef struct mbstate_s mbstate_t;
|
||||
#endif
|
||||
|
||||
/* FILE
|
||||
* As described in <stdio.h>.
|
||||
@@ -218,6 +221,8 @@ size_t wcscspn(const wchar_t *, const wchar_t *);
|
||||
size_t wcsftime(wchar_t *, size_t, const wchar_t *,
|
||||
const struct tm *);
|
||||
size_t wcslen(const wchar_t *);
|
||||
size_t wcslcpy(FAR wchar_t *, FAR const wchar_t *, size_t);
|
||||
size_t wcslcat(FAR wchar_t *, FAR const wchar_t *, size_t);
|
||||
wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t);
|
||||
int wcsncmp(const wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t);
|
||||
|
||||
Reference in New Issue
Block a user