Switch to the OpenBSD implementations of the wide scanf functions.
This also gets us the C99 wcstoimax and wcstoumax, and a working fgetwc and ungetwc, all of which are needed in the implementation. This also brings several other files closer to upstream. Change-Id: I23b025a8237a6dbb9aa50d2a96765ea729a85579
This commit is contained in:
19
libc/upstream-openbsd/lib/libc/locale/wcstoimax.c
Normal file
19
libc/upstream-openbsd/lib/libc/locale/wcstoimax.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/* $OpenBSD: wcstoimax.c,v 1.1 2009/01/13 18:13:51 kettenis Exp $ */
|
||||
/* $NetBSD: wcstol.c,v 1.2 2003/03/11 09:21:23 tshiozak Exp $ */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#include "wctoint.h"
|
||||
|
||||
#define FUNCNAME wcstoimax
|
||||
typedef intmax_t int_type;
|
||||
#define MIN_VALUE INTMAX_MIN
|
||||
#define MAX_VALUE INTMAX_MAX
|
||||
|
||||
#include "_wcstol.h"
|
||||
18
libc/upstream-openbsd/lib/libc/locale/wcstoumax.c
Normal file
18
libc/upstream-openbsd/lib/libc/locale/wcstoumax.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* $OpenBSD: wcstoumax.c,v 1.1 2009/01/13 18:13:51 kettenis Exp $ */
|
||||
/* $NetBSD: wcstoul.c,v 1.2 2003/03/11 09:21:24 tshiozak Exp $ */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#include "wctoint.h"
|
||||
|
||||
#define FUNCNAME wcstoumax
|
||||
typedef uintmax_t uint_type;
|
||||
#define MAX_VALUE UINTMAX_MAX
|
||||
|
||||
#include "_wcstoul.h"
|
||||
Reference in New Issue
Block a user