Made a minimum subset build - mbrtowc() is currently a hack to make it work...

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8967 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-09-15 12:20:03 +00:00
parent fd3e280e83
commit 5e4171c975
3 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,18 @@
SubDir OBOS_TOP src kernel libroot posix glibc wcsmbs ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc include arch $(OBOS_ARCH) ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc wcsmbs ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc include ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc iconv ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc locale ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc libio ;
SubDirHdrs $(OBOS_TOP) src kernel libroot posix glibc ;
# ToDo: for now, all wide character functions are disabled
KernelMergeObject posix_gnu_wcsmbs.o :
mbrlen.c
mbrtowc.c
mbsinit.c
: -fPIC -DPIC
;

View File

@ -21,7 +21,7 @@
#include <errno.h>
#include <gconv.h>
#include <wchar.h>
#include <wcsmbsload.h>
//#include <wcsmbsload.h>
#include <assert.h>
@ -35,6 +35,19 @@ static mbstate_t state;
size_t
__mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
{
// ToDo: this is a dummy implementation to get it going
if (s == NULL)
n = 1, s = "";
if (pwc == NULL || n == 0)
return 0;
if (ps == NULL)
ps = &state;
pwc[0] = s[0];
return s[0] == 0 ? 0 : 1;
#if 0
wchar_t buf[1];
struct __gconv_step_data data;
int status;
@ -104,6 +117,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
}
return result;
#endif
}
libc_hidden_def (__mbrtowc)
weak_alias (__mbrtowc, mbrtowc)

View File

@ -23,6 +23,8 @@
#ifndef _WCHAR_H
#include <iconv/gconv.h>
#ifndef __need_mbstate_t
# define _WCHAR_H 1
# include <features.h>