sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-21 03:05:03 +00:00
parent cb9f36df51
commit 6b5b190599
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
48 changed files with 1492 additions and 422 deletions

View file

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.230 2022/08/30 18:50:06 krw Exp $
# $OpenBSD: Makefile,v 1.231 2023/08/20 15:02:50 schwarze Exp $
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
@ -27,7 +27,7 @@ FILES= a.out.h ar.h asr.h assert.h \
signal.h siphash.h sndio.h spawn.h stdbool.h stddef.h \
stdio.h stdlib.h string.h strings.h sysexits.h \
tar.h tgmath.h tib.h time.h ttyent.h \
unistd.h utime.h utmp.h uuid.h \
uchar.h unistd.h utime.h utmp.h uuid.h \
vis.h \
wchar.h wctype.h

38
include/uchar.h Normal file
View file

@ -0,0 +1,38 @@
/* $OpenBSD: uchar.h,v 1.1 2023/08/20 15:02:50 schwarze Exp $ */
/*
* Written by Ingo Schwarze <schwarze@openbsd.org>
* and placed in the public domain on March 19, 2022.
*/
#ifndef _UCHAR_H_
#define _UCHAR_H_
#include <sys/cdefs.h>
#include <sys/_types.h>
#ifndef _MBSTATE_T_DEFINED_
#define _MBSTATE_T_DEFINED_
typedef __mbstate_t mbstate_t;
#endif
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef __size_t size_t;
#endif
#define __STDC_UTF_16__ 1
#define __STDC_UTF_32__ 1
typedef __uint16_t char16_t;
typedef __uint32_t char32_t;
__BEGIN_DECLS
size_t mbrtoc16(char16_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict);
size_t c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict);
size_t mbrtoc32(char32_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict);
size_t c32rtomb(char * __restrict, char32_t, mbstate_t * __restrict);
__END_DECLS
#endif /* !_UCHAR_H_ */