Stub implementations of some wchar functions

This commit is contained in:
Max Wash
2020-07-24 10:50:40 +01:00
parent 04ee711f31
commit 142662f84c
7 changed files with 39 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ set(CMAKE_EXE_LINKER_FLAGS
set(malloc_impl dlmalloc) set(malloc_impl dlmalloc)
set(photon_libc_sources "") 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}") message(STATUS "Memory allocator: ${malloc_impl}")

View File

@@ -0,0 +1,4 @@
#ifndef LOCALE_H_
#define LOCALE_H_
#endif

View File

@@ -10,6 +10,8 @@ extern "C" {
extern _Noreturn void abort(void); extern _Noreturn void abort(void);
extern _Noreturn void exit(int code); extern _Noreturn void exit(int code);
extern void *malloc(size_t sz); 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 void free(void *ptr);
extern int atoi(const char *str); extern int atoi(const char *str);

View 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

View File

@@ -0,0 +1,6 @@
#include <stdio.h>
int fwide(FILE *fp, int mode)
{
return 0;
}

View File

@@ -0,0 +1,6 @@
#include <wchar.h>
int vfwprintf(FILE *fp, const wchar_t *format, va_list arg)
{
return 0;
}

View 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;
}