Switch to the OpenBSD wcsto* functions.

This replaces a partial set of non-functional functions with a complete
set of functions, all of which actually work.

This requires us to implement mbsnrtowcs and wcsnrtombs which completes
the set of what we need for libc++.

The mbsnrtowcs is basically a copy & paste of wcsnrtombs, but I'm going
to go straight to looking at using the OpenBSD UTF-8 implementation rather
than keep polishing our home-grown turd.

(This patch also opportunistically switches us over to upstream btowc,
mbrlen, and wctob, since they're all trivially expressed in terms of
other functions.)

Change-Id: I0f81443840de0f1aa73b96f0b51988976793a323
This commit is contained in:
Elliott Hughes
2014-04-29 14:46:56 -07:00
parent 07bab525e2
commit 3d7a0d9b08
22 changed files with 935 additions and 54 deletions

View File

@@ -0,0 +1,13 @@
/* $OpenBSD: wcstold.c,v 1.1 2009/01/13 18:18:31 kettenis Exp $ */
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#define FUNCNAME wcstold
typedef long double float_type;
#define STRTOD_FUNC strtold
#include "_wcstod.h"