Stub implementations of some wchar functions
This commit is contained in:
@@ -25,7 +25,7 @@ set(CMAKE_EXE_LINKER_FLAGS
|
||||
|
||||
set(malloc_impl dlmalloc)
|
||||
set(photon_libc_sources "")
|
||||
set(generic_dirs string stdio stdlib errno internal ctype)
|
||||
set(generic_dirs string stdio stdlib errno internal ctype wchar)
|
||||
|
||||
message(STATUS "Memory allocator: ${malloc_impl}")
|
||||
|
||||
|
||||
4
photon/libc/include/locale.h
Normal file
4
photon/libc/include/locale.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef LOCALE_H_
|
||||
#define LOCALE_H_
|
||||
|
||||
#endif
|
||||
@@ -10,6 +10,8 @@ extern "C" {
|
||||
extern _Noreturn void abort(void);
|
||||
extern _Noreturn void exit(int code);
|
||||
extern void *malloc(size_t sz);
|
||||
extern void *realloc(void *ptr, size_t sz);
|
||||
extern void *calloc(size_t n, size_t sz);
|
||||
extern void free(void *ptr);
|
||||
|
||||
extern int atoi(const char *str);
|
||||
|
||||
14
photon/libc/include/wchar.h
Normal file
14
photon/libc/include/wchar.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef WCHAR_H_
|
||||
#define WCHAR_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
typedef unsigned int wchar_t;
|
||||
|
||||
extern int fwide(FILE *fp, int mode);
|
||||
|
||||
extern int vfwprintf(FILE *stream, const wchar_t *format, va_list arg);
|
||||
extern int vswprintf(wchar_t *buf, size_t len, const wchar_t *format, va_list arg);
|
||||
|
||||
#endif
|
||||
6
photon/libc/wchar/fwide.c
Normal file
6
photon/libc/wchar/fwide.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int fwide(FILE *fp, int mode)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
6
photon/libc/wchar/vfwprintf.c
Normal file
6
photon/libc/wchar/vfwprintf.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <wchar.h>
|
||||
|
||||
int vfwprintf(FILE *fp, const wchar_t *format, va_list arg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
6
photon/libc/wchar/vswprintf.c
Normal file
6
photon/libc/wchar/vswprintf.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <wchar.h>
|
||||
|
||||
int vswprintf(wchar_t *buf, size_t len, const wchar_t *format, va_list arg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user