mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Use alternate restrict keyword when unavailable.
This commit is contained in:
parent
d7c8e1e6df
commit
3eeec255c0
13 changed files with 136 additions and 123 deletions
|
@ -74,8 +74,24 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef restrict
|
||||
#define restrict
|
||||
/* Detect whether the restrict keyword is available. */
|
||||
#if __STDC_VERSION__ >= 199901L
|
||||
#define __HAS_RESTRICT 1
|
||||
#endif
|
||||
|
||||
/* Use the real restrict keyword if it is available. Not that this really
|
||||
matters as gcc uses __restrict and __restrict__ as aliases for restrict, but
|
||||
it will look nicer after preprocessing. */
|
||||
#if __HAS_RESTRICT
|
||||
#undef __restrict
|
||||
#define __restrict restrict
|
||||
#endif
|
||||
|
||||
/* Provide the restrict keyword when building the C library. */
|
||||
#if !__HAS_RESTRICT && defined(LIBC_LIBRARY)
|
||||
#define restrict __restrict
|
||||
#undef __HAS_RESTRICT
|
||||
#define __HAS_RESTRICT 2
|
||||
#endif
|
||||
|
||||
/* TODO: Improve these declarations, perhaps like they are in glibc. */
|
||||
|
|
|
@ -118,11 +118,11 @@ void endprotoent(void);
|
|||
void endservent(void);
|
||||
void freeaddrinfo(struct addrinfo*);
|
||||
const char* gai_strerror(int);
|
||||
int getaddrinfo(const char* restrict, const char* restrict,
|
||||
const struct addrinfo* restrict, struct addrinfo** restrict);
|
||||
int getaddrinfo(const char* __restrict, const char* __restrict,
|
||||
const struct addrinfo* __restrict, struct addrinfo** __restrict);
|
||||
struct hostent* gethostent(void);
|
||||
int getnameinfo(const struct sockaddr* restrict, socklen_t, char* restrict,
|
||||
socklen_t, char* restrict, socklen_t, int);
|
||||
int getnameinfo(const struct sockaddr* __restrict, socklen_t, char* __restrict,
|
||||
socklen_t, char* __restrict, socklen_t, int);
|
||||
struct netent* getnetbyaddr(uint32_t, int);
|
||||
struct netent* getnetbyname(const char*);
|
||||
struct netent* getnetent(void);
|
||||
|
|
|
@ -80,27 +80,27 @@ extern int ferror(FILE* stream);
|
|||
extern int fflush(FILE* stream);
|
||||
extern int fileno(FILE* stream);
|
||||
extern int fgetc(FILE* stream);
|
||||
extern char* fgets(char* restrict s, int n, FILE* restrict stream);
|
||||
extern FILE* fopen(const char* restrict filename, const char* restrict mode);
|
||||
extern int fprintf(FILE* restrict stream, const char* restrict format, ...);
|
||||
extern char* fgets(char* __restrict s, int n, FILE* __restrict stream);
|
||||
extern FILE* fopen(const char* __restrict filename, const char* __restrict mode);
|
||||
extern int fprintf(FILE* __restrict stream, const char* __restrict format, ...);
|
||||
extern int fputc(int c, FILE* stream);
|
||||
extern int fputs(const char* restrict s, FILE* restrict stream);
|
||||
extern size_t fread(void* restrict ptr, size_t size, size_t nitems, FILE* restrict stream);
|
||||
extern FILE* freopen(const char* restrict filename, const char *restrict mode, FILE* restrict stream);
|
||||
extern int fscanf(FILE* restrict stream, const char* restrict format, ... );
|
||||
extern int fputs(const char* __restrict s, FILE* __restrict stream);
|
||||
extern size_t fread(void* __restrict ptr, size_t size, size_t nitems, FILE* __restrict stream);
|
||||
extern FILE* freopen(const char* __restrict filename, const char *__restrict mode, FILE* __restrict stream);
|
||||
extern int fscanf(FILE* __restrict stream, const char* __restrict format, ... );
|
||||
extern int fseek(FILE* stream, long offset, int whence);
|
||||
extern int fseeko(FILE* stream, off_t offset, int whence);
|
||||
extern long ftell(FILE* stream);
|
||||
extern off_t ftello(FILE* stream);
|
||||
extern size_t fwrite(const void* restrict ptr, size_t size, size_t nitems, FILE* restrict stream);
|
||||
extern size_t fwrite(const void* __restrict ptr, size_t size, size_t nitems, FILE* __restrict stream);
|
||||
extern int getc(FILE* stream);
|
||||
extern int getchar(void);
|
||||
extern ssize_t getdelim(char** restrict lineptr, size_t* restrict n, int delimiter, FILE* restrict stream);
|
||||
extern ssize_t getline(char** restrict lineptr, size_t* restrict n, FILE* restrict stream);
|
||||
extern ssize_t getdelim(char** __restrict lineptr, size_t* __restrict n, int delimiter, FILE* __restrict stream);
|
||||
extern ssize_t getline(char** __restrict lineptr, size_t* __restrict n, FILE* __restrict stream);
|
||||
extern int pclose(FILE* steam);
|
||||
extern void perror(const char* s);
|
||||
extern FILE* popen(const char* command, const char* mode);
|
||||
extern int printf(const char* restrict format, ...);
|
||||
extern int printf(const char* __restrict format, ...);
|
||||
extern int putc(int c, FILE* stream);
|
||||
extern int putchar(int c);
|
||||
extern int puts(const char* str);
|
||||
|
@ -109,38 +109,38 @@ extern int remove(const char* path);
|
|||
extern int renameat(int oldfd, const char* oldname, int newfd, const char* newname);
|
||||
extern int rename(const char* oldname, const char* newname);
|
||||
extern void rewind(FILE* stream);
|
||||
extern int snprintf(char* restrict s, size_t n, const char* restrict format, ...);
|
||||
extern void setbuf(FILE* restrict stream, char* restrict buf);
|
||||
extern int setvbuf(FILE* restrict stream, char* restrict buf, int type, size_t size);
|
||||
extern int snprintf(char* __restrict s, size_t n, const char* __restrict format, ...);
|
||||
extern void setbuf(FILE* __restrict stream, char* __restrict buf);
|
||||
extern int setvbuf(FILE* __restrict stream, char* __restrict buf, int type, size_t size);
|
||||
extern char* sortix_gets(void);
|
||||
extern int sortix_puts(const char* str);
|
||||
extern int sprintf(char* restrict s, const char* restrict format, ...);
|
||||
extern int scanf(const char* restrict format, ...);
|
||||
extern int sscanf(const char* restrict s, const char* restrict format, ...);
|
||||
extern int sprintf(char* __restrict s, const char* __restrict format, ...);
|
||||
extern int scanf(const char* __restrict format, ...);
|
||||
extern int sscanf(const char* __restrict s, const char* __restrict format, ...);
|
||||
extern FILE* tmpfile(void);
|
||||
extern int ungetc(int c, FILE* stream);
|
||||
extern int vfprintf(FILE* restrict stream, const char* restrict format, __gnuc_va_list ap);
|
||||
extern int vfscanf(FILE* restrict stream, const char* restrict format, __gnuc_va_list arg);
|
||||
extern int vprintf(const char* restrict format, __gnuc_va_list ap);
|
||||
extern int vscanf(const char* restrict format, __gnuc_va_list arg);
|
||||
extern int vsnprintf(char* restrict, size_t, const char* restrict, __gnuc_va_list);
|
||||
extern int vsprintf(char* restrict s, const char* restrict format, __gnuc_va_list ap);
|
||||
extern int vsscanf(const char* restrict s, const char* restrict format, __gnuc_va_list arg);
|
||||
extern int vfprintf(FILE* __restrict stream, const char* __restrict format, __gnuc_va_list ap);
|
||||
extern int vfscanf(FILE* __restrict stream, const char* __restrict format, __gnuc_va_list arg);
|
||||
extern int vprintf(const char* __restrict format, __gnuc_va_list ap);
|
||||
extern int vscanf(const char* __restrict format, __gnuc_va_list arg);
|
||||
extern int vsnprintf(char* __restrict, size_t, const char* __restrict, __gnuc_va_list);
|
||||
extern int vsprintf(char* __restrict s, const char* __restrict format, __gnuc_va_list ap);
|
||||
extern int vsscanf(const char* __restrict s, const char* __restrict format, __gnuc_va_list arg);
|
||||
|
||||
/* TODO: These are not implemented in sortix libc yet. */
|
||||
#if defined(__SORTIX_SHOW_UNIMPLEMENTED)
|
||||
extern char* ctermid(char* s);
|
||||
extern FILE *fmemopen(void* restrict buf, size_t size, const char* restrict mode);
|
||||
extern FILE *fmemopen(void* __restrict buf, size_t size, const char* __restrict mode);
|
||||
extern FILE* open_memstream(char** bufp, size_t* sizep);
|
||||
extern int dprintf(int fildes, const char* restrict format, ...);
|
||||
extern int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
|
||||
extern int dprintf(int fildes, const char* __restrict format, ...);
|
||||
extern int fgetpos(FILE* __restrict stream, fpos_t* __restrict pos);
|
||||
extern int fsetpos(FILE* stream, const fpos_t* pos);
|
||||
extern int ftrylockfile(FILE* file);
|
||||
extern int getchar_unlocked(void);
|
||||
extern int getc_unlocked(FILE* stream);
|
||||
extern int putchar_unlocked(int c);
|
||||
extern int putc_unlocked(int c, FILE* steam);
|
||||
extern int vdprintf(int fildes, const char* restrict format, __gnuc_va_list ap);
|
||||
extern int vdprintf(int fildes, const char* __restrict format, __gnuc_va_list ap);
|
||||
extern void flockfile(FILE* file);
|
||||
extern void funlockfile(FILE* file);
|
||||
|
||||
|
@ -190,7 +190,7 @@ extern char* gets(void) asm ("sortix_gets");
|
|||
#if defined(_SORTIX_SOURCE) || defined(_WANT_SORTIX_VPRINTF_CALLBACK)
|
||||
extern size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t),
|
||||
void* user,
|
||||
const char* restrict format,
|
||||
const char* __restrict format,
|
||||
__gnuc_va_list ap);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -81,8 +81,8 @@ ldiv_t ldiv(long, long);
|
|||
long long llabs(long long);
|
||||
lldiv_t lldiv(long long, long long);
|
||||
void* malloc(size_t);
|
||||
size_t mbstowcs(wchar_t* restrict, const char* restrict, size_t);
|
||||
int mbtowc(wchar_t *restrict, const char* restrict, size_t);
|
||||
size_t mbstowcs(wchar_t* __restrict, const char* __restrict, size_t);
|
||||
int mbtowc(wchar_t *__restrict, const char* __restrict, size_t);
|
||||
#if !defined(_SORTIX_SOURCE)
|
||||
char* mktemp(char* templ);
|
||||
#endif
|
||||
|
@ -91,16 +91,16 @@ int putenv(char*);
|
|||
void qsort(void*, size_t, size_t, int (*)(const void*, const void*));
|
||||
int rand(void);
|
||||
void* realloc(void*, size_t);
|
||||
char* realpath(const char* restrict, char* restrict);
|
||||
char* realpath(const char* __restrict, char* __restrict);
|
||||
int setenv(const char*, const char*, int);
|
||||
void srand(unsigned);
|
||||
long strtol(const char* restrict, char** restrict, int);
|
||||
unsigned long strtoul(const char* restrict, char** restrict, int);
|
||||
unsigned long long strtoull(const char* restrict, char** restrict, int);
|
||||
long long strtoll(const char* restrict, char** restrict, int);
|
||||
long strtol(const char* __restrict, char** __restrict, int);
|
||||
unsigned long strtoul(const char* __restrict, char** __restrict, int);
|
||||
unsigned long long strtoull(const char* __restrict, char** __restrict, int);
|
||||
long long strtoll(const char* __restrict, char** __restrict, int);
|
||||
int system(const char*);
|
||||
int unsetenv(const char*);
|
||||
size_t wcstombs(char* restrict, const wchar_t *restrict, size_t);
|
||||
size_t wcstombs(char* __restrict, const wchar_t *__restrict, size_t);
|
||||
int wctomb(char*, wchar_t);
|
||||
|
||||
#if defined(_SORTIX_SOURCE) || defined(_WANT_SORTIX_ENV)
|
||||
|
@ -146,9 +146,9 @@ void setkey(const char*);
|
|||
char* setstate(char*);
|
||||
void srand48(long);
|
||||
void srandom(unsigned);
|
||||
double strtod(const char* restrict, char** restrict);
|
||||
float strtof(const char* restrict, char** restrict);
|
||||
long double strtold(const char* restrict, char** restrict);
|
||||
double strtod(const char* __restrict, char** __restrict);
|
||||
float strtof(const char* __restrict, char** __restrict);
|
||||
long double strtold(const char* __restrict, char** __restrict);
|
||||
int unlockpt(int);
|
||||
|
||||
#if __POSIX_OBSOLETE <= 200801
|
||||
|
|
|
@ -34,41 +34,41 @@ __BEGIN_DECLS
|
|||
@include(size_t.h)
|
||||
@include(locale_t.h)
|
||||
|
||||
void* memccpy(void* restrict, const void* restrict, int, size_t);
|
||||
void* memccpy(void* __restrict, const void* __restrict, int, size_t);
|
||||
void* memchr(const void*, int, size_t);
|
||||
int memcmp(const void*, const void*, size_t);
|
||||
void* memcpy(void* restrict, const void* restrict, size_t);
|
||||
void* memcpy(void* __restrict, const void* __restrict, size_t);
|
||||
void* memmove(void*, const void*, size_t);
|
||||
void* memset(void*, int, size_t);
|
||||
char* stpcpy(char* restrict, const char* restrict);
|
||||
char* stpncpy(char* restrict, const char* restrict, size_t);
|
||||
char* strcat(char* restrict, const char* restrict);
|
||||
char* stpcpy(char* __restrict, const char* __restrict);
|
||||
char* stpncpy(char* __restrict, const char* __restrict, size_t);
|
||||
char* strcat(char* __restrict, const char* __restrict);
|
||||
char* strchr(const char*, int);
|
||||
int strcmp(const char*, const char*);
|
||||
int strcoll(const char*, const char*);
|
||||
size_t strcspn(const char*, const char*);
|
||||
char* strcpy(char* restrict, const char* restrict);
|
||||
char* strcpy(char* __restrict, const char* __restrict);
|
||||
char* strdup(const char*);
|
||||
size_t strlen(const char*);
|
||||
char* strncat(char* restrict, const char* restrict, size_t);
|
||||
char* strncat(char* __restrict, const char* __restrict, size_t);
|
||||
int strncmp(const char*, const char*, size_t);
|
||||
char* strncpy(char* restrict, const char* restrict, size_t);
|
||||
char* strncpy(char* __restrict, const char* __restrict, size_t);
|
||||
char* strndup(const char*, size_t);
|
||||
size_t strnlen(const char*, size_t);
|
||||
char* strpbrk(const char*, const char*);
|
||||
char* strrchr(const char*, int);
|
||||
size_t strspn(const char*, const char*);
|
||||
char* strstr(const char*, const char*);
|
||||
char* strtok(char* restrict, const char* restrict);
|
||||
char* strtok_r(char* restrict, const char* restrict, char** restrict);
|
||||
size_t strxfrm(char* restrict, const char* restrict, size_t);
|
||||
char* strtok(char* __restrict, const char* __restrict);
|
||||
char* strtok_r(char* __restrict, const char* __restrict, char** __restrict);
|
||||
size_t strxfrm(char* __restrict, const char* __restrict, size_t);
|
||||
|
||||
/* TODO: These are not implemented in sortix libc yet. */
|
||||
#if defined(__SORTIX_SHOW_UNIMPLEMENTED)
|
||||
int strcoll_l(const char*, const char*, locale_t);
|
||||
char* strerror_l(int, locale_t);
|
||||
int strerror_r(int, char*, size_t);
|
||||
size_t strxfrm_l(char* restrict, const char* restrict, size_t, locale_t);
|
||||
size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale_t);
|
||||
#endif
|
||||
|
||||
#if defined(_SORTIX_SOURCE) || defined(_GNU_SOURCE)
|
||||
|
|
|
@ -60,8 +60,8 @@ typedef struct
|
|||
#define FD_ZERO(fdsetp) memset(fdsetp, 0, sizeof(fd_set))
|
||||
|
||||
/* TODO: pselect */
|
||||
int select(int, fd_set* restrict, fd_set* restrict, fd_set* restrict,
|
||||
struct timeval* restrict);
|
||||
int select(int, fd_set* __restrict, fd_set* __restrict, fd_set* __restrict,
|
||||
struct timeval* __restrict);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
|
|
@ -132,17 +132,17 @@ struct linger
|
|||
#define SHUT_RDWR 1
|
||||
#define SHUT_WR 2
|
||||
|
||||
int accept4(int, struct sockaddr* restrict, socklen_t* restrict, int);
|
||||
int accept(int, struct sockaddr* restrict, socklen_t* restrict);
|
||||
int accept4(int, struct sockaddr* __restrict, socklen_t* __restrict, int);
|
||||
int accept(int, struct sockaddr* __restrict, socklen_t* __restrict);
|
||||
int bind(int, const struct sockaddr*, socklen_t);
|
||||
int connect(int, const struct sockaddr*, socklen_t);
|
||||
int getpeername(int, struct sockaddr* restrict, socklen_t* restrict);
|
||||
int getsockname(int, struct sockaddr* restrict, socklen_t* restrict);
|
||||
int getsockopt(int, int, int, void* restrict, socklen_t* restrict);
|
||||
int getpeername(int, struct sockaddr* __restrict, socklen_t* __restrict);
|
||||
int getsockname(int, struct sockaddr* __restrict, socklen_t* __restrict);
|
||||
int getsockopt(int, int, int, void* __restrict, socklen_t* __restrict);
|
||||
int listen(int, int);
|
||||
ssize_t recv(int, void*, size_t, int);
|
||||
ssize_t recvfrom(int, void* restrict, size_t, int,
|
||||
struct sockaddr* restrict, socklen_t* restrict);
|
||||
ssize_t recvfrom(int, void* __restrict, size_t, int,
|
||||
struct sockaddr* __restrict, socklen_t* __restrict);
|
||||
ssize_t recvmsg(int, struct msghdr*, int);
|
||||
ssize_t send(int, const void*, size_t, int);
|
||||
ssize_t sendmsg(int, const struct msghdr*, int);
|
||||
|
|
|
@ -61,14 +61,14 @@ int fchmodat(int dirfd, const char* path, mode_t mode, int flags);
|
|||
int fstat(int fd, struct stat* st);
|
||||
int fstatat(int dirfd, const char* path, struct stat* buf, int flags);
|
||||
int futimens(int fd, const struct timespec times[2]);
|
||||
int lstat(const char* restrict path, struct stat* restrict st);
|
||||
int lstat(const char* __restrict path, struct stat* __restrict st);
|
||||
int mkdir(const char* path, mode_t mode);
|
||||
int mkdirat(int dirfd, const char* path, mode_t mode);
|
||||
/* TODO: mkfifo */
|
||||
/* TODO: mkfifoat */
|
||||
/* TODO: mknod? */
|
||||
/* TODO: mknodat? */
|
||||
int stat(const char* restrict path, struct stat* restrict st);
|
||||
int stat(const char* __restrict path, struct stat* __restrict st);
|
||||
mode_t umask(mode_t mask);
|
||||
int utimens(const char* path, const struct timespec times[2]);
|
||||
int utimensat(int dirfd, const char* path, const struct timespec times[2],
|
||||
|
|
|
@ -33,7 +33,7 @@ __BEGIN_DECLS
|
|||
@include(suseconds_t.h)
|
||||
@include(timeval.h)
|
||||
|
||||
int gettimeofday(struct timeval* restrict tp, void* restrict tzp);
|
||||
int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ __BEGIN_DECLS
|
|||
/* getdate_err is omitted, use strptime */
|
||||
|
||||
char* asctime(const struct tm*);
|
||||
char* asctime_r(const struct tm* restrict, char* restrict);
|
||||
char* asctime_r(const struct tm* __restrict, char* __restrict);
|
||||
clock_t clock(void);
|
||||
/* TODO: clock_getcpuclockid */
|
||||
int clock_getres(clockid_t, struct timespec*);
|
||||
|
@ -89,24 +89,24 @@ char* ctime_r(const time_t* clock, char* buf);
|
|||
double difftime(time_t, time_t);
|
||||
/* getdate is omitted, use strptime */
|
||||
struct tm* gmtime(const time_t*);
|
||||
struct tm* gmtime_r(const time_t* restrict, struct tm* restrict);
|
||||
struct tm* gmtime_r(const time_t* __restrict, struct tm* __restrict);
|
||||
struct tm* localtime(const time_t*);
|
||||
struct tm* localtime_r(const time_t* restrict, struct tm* restrict);
|
||||
struct tm* localtime_r(const time_t* __restrict, struct tm* __restrict);
|
||||
time_t mktime(struct tm*);
|
||||
int nanosleep(const struct timespec*, struct timespec*);
|
||||
size_t strftime(char* restrict, size_t, const char* restrict,
|
||||
const struct tm* restrict);
|
||||
size_t strftime_l(char* restrict, size_t, const char* restrict,
|
||||
const struct tm* restrict, locale_t);
|
||||
char* strptime(const char* restrict, const char* restrict,
|
||||
struct tm* restrict);
|
||||
size_t strftime(char* __restrict, size_t, const char* __restrict,
|
||||
const struct tm* __restrict);
|
||||
size_t strftime_l(char* __restrict, size_t, const char* __restrict,
|
||||
const struct tm* __restrict, locale_t);
|
||||
char* strptime(const char* __restrict, const char* __restrict,
|
||||
struct tm* __restrict);
|
||||
time_t time(time_t*);
|
||||
int timer_create(clockid_t, struct sigevent* restrict, time_t* restrict);
|
||||
int timer_create(clockid_t, struct sigevent* __restrict, time_t* __restrict);
|
||||
int timer_delete(timer_t);
|
||||
int timer_getoverrun(timer_t);
|
||||
int timer_gettime(timer_t, struct itimerspec*);
|
||||
int timer_settime(timer_t, int, const struct itimerspec* restrict,
|
||||
struct itimerspec* restrict);
|
||||
int timer_settime(timer_t, int, const struct itimerspec* __restrict,
|
||||
struct itimerspec* __restrict);
|
||||
void tzset(void);
|
||||
|
||||
extern int daylight;
|
||||
|
|
|
@ -129,7 +129,7 @@ int setpgid(pid_t, pid_t);
|
|||
int setregid(gid_t, gid_t);
|
||||
int setreuid(uid_t, uid_t);
|
||||
pid_t setsid(void);
|
||||
void swab(const void* restrict, void* restrict, ssize_t);
|
||||
void swab(const void* __restrict, void* __restrict, ssize_t);
|
||||
int symlink(const char*, const char*);
|
||||
int symlinkat(const char*, int, const char*);
|
||||
void sync(void);
|
||||
|
@ -183,8 +183,8 @@ long pathconf(const char*, int);
|
|||
int pipe(int [2]);
|
||||
ssize_t pread(int, void*, size_t, off_t);
|
||||
ssize_t pwrite(int, const void*, size_t, off_t);
|
||||
ssize_t readlink(const char* restrict, char* restrict, size_t);
|
||||
ssize_t readlinkat(int, const char* restrict, char* restrict, size_t);
|
||||
ssize_t readlink(const char* __restrict, char* __restrict, size_t);
|
||||
ssize_t readlinkat(int, const char* __restrict, char* __restrict, size_t);
|
||||
ssize_t read(int, void*, size_t);
|
||||
int rmdir(const char*);
|
||||
int setegid(gid_t);
|
||||
|
|
|
@ -61,63 +61,63 @@ __BEGIN_DECLS
|
|||
|
||||
struct tm;
|
||||
|
||||
size_t mbsrtowcs(wchar_t* restrict, const char** restrict, size_t, mbstate_t* restrict);
|
||||
size_t wcrtomb(char* restrict, wchar_t, mbstate_t* restrict);
|
||||
size_t mbrtowc(wchar_t* restrict, const char* restrict, size_t, mbstate_t* restrict);
|
||||
wchar_t* wcscat(wchar_t* restrict, const wchar_t* restrict);
|
||||
size_t mbsrtowcs(wchar_t* __restrict, const char** __restrict, size_t, mbstate_t* __restrict);
|
||||
size_t wcrtomb(char* __restrict, wchar_t, mbstate_t* __restrict);
|
||||
size_t mbrtowc(wchar_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict);
|
||||
wchar_t* wcscat(wchar_t* __restrict, const wchar_t* __restrict);
|
||||
wchar_t* wcschr(const wchar_t*, wchar_t);
|
||||
wchar_t* wcschrnul(const wchar_t*, wchar_t);
|
||||
int wcscmp(const wchar_t*, const wchar_t*);
|
||||
wchar_t* wcscpy(wchar_t* restrict, const wchar_t* restrict);
|
||||
wchar_t* wcscpy(wchar_t* __restrict, const wchar_t* __restrict);
|
||||
size_t wcscspn(const wchar_t*, const wchar_t*);
|
||||
size_t wcslen(const wchar_t*);
|
||||
wchar_t* wcsncat(wchar_t* restrict, const wchar_t* restrict, size_t);
|
||||
wchar_t* wcsncpy(wchar_t* restrict, const wchar_t* restrict, size_t);
|
||||
wchar_t* wcsncat(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
||||
wchar_t* wcsncpy(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
||||
wchar_t* wcsrchr(const wchar_t*, wchar_t);
|
||||
size_t wcsrtombs(char* restrict, const wchar_t** restrict, size_t, mbstate_t* restrict);
|
||||
size_t wcsrtombs(char* __restrict, const wchar_t** __restrict, size_t, mbstate_t* __restrict);
|
||||
size_t wcsspn(const wchar_t*, const wchar_t*);
|
||||
wchar_t* wcstok(wchar_t* restrict, const wchar_t* restrict, wchar_t** restrict);
|
||||
wchar_t* wcstok(wchar_t* __restrict, const wchar_t* __restrict, wchar_t** __restrict);
|
||||
|
||||
/* TODO: These are not implemented in sortix libc yet. */
|
||||
#if defined(__SORTIX_SHOW_UNIMPLEMENTED)
|
||||
double wcstod(const wchar_t* restrict, wchar_t** restrict);
|
||||
double wcstod(const wchar_t* __restrict, wchar_t** __restrict);
|
||||
FILE* open_wmemstream(wchar_t** bufp, size_t* sizep);
|
||||
float wcstof(const wchar_t* restrict, wchar_t** restrict);
|
||||
int fputws(const wchar_t* restrict, FILE* restrict);
|
||||
float wcstof(const wchar_t* __restrict, wchar_t** __restrict);
|
||||
int fputws(const wchar_t* __restrict, FILE* __restrict);
|
||||
int fwide(FILE*, int);
|
||||
int fwprintf(FILE* restrict, const wchar_t* restrict, ...);
|
||||
int fwscanf(FILE* restrict, const wchar_t* restrict, ...);
|
||||
int fwprintf(FILE* __restrict, const wchar_t* __restrict, ...);
|
||||
int fwscanf(FILE* __restrict, const wchar_t* __restrict, ...);
|
||||
int mbsinit(const mbstate_t*);
|
||||
int swprintf(wchar_t* restrict, size_t, const wchar_t* restrict, ...);
|
||||
int swscanf(const wchar_t* restrict, const wchar_t* restrict, ...);
|
||||
int vfwprintf(FILE* restrict, const wchar_t* restrict, va_list);
|
||||
int vfwscanf(FILE* restrict, const wchar_t* restrict, va_list);
|
||||
int vswprintf(wchar_t* restrict, size_t, const wchar_t* restrict, va_list);
|
||||
int vswscanf(const wchar_t* restrict, const wchar_t* restrict, va_list);
|
||||
int vwprintf(const wchar_t* restrict, va_list);
|
||||
int vwscanf(const wchar_t* restrict, va_list);
|
||||
int swprintf(wchar_t* __restrict, size_t, const wchar_t* __restrict, ...);
|
||||
int swscanf(const wchar_t* __restrict, const wchar_t* __restrict, ...);
|
||||
int vfwprintf(FILE* __restrict, const wchar_t* __restrict, va_list);
|
||||
int vfwscanf(FILE* __restrict, const wchar_t* __restrict, va_list);
|
||||
int vswprintf(wchar_t* __restrict, size_t, const wchar_t* __restrict, va_list);
|
||||
int vswscanf(const wchar_t* __restrict, const wchar_t* __restrict, va_list);
|
||||
int vwprintf(const wchar_t* __restrict, va_list);
|
||||
int vwscanf(const wchar_t* __restrict, va_list);
|
||||
int wcscoll(const wchar_t*, const wchar_t*);
|
||||
int wcsncmp(const wchar_t*, const wchar_t*, size_t);
|
||||
int wcswidth(const wchar_t*, size_t);
|
||||
int wctob(wint_t);
|
||||
int wcwidth(wchar_t);
|
||||
int wmemcmp(const wchar_t*, const wchar_t*, size_t);
|
||||
int wprintf(const wchar_t* restrict, ...);
|
||||
int wscanf(const wchar_t* restrict, ...);
|
||||
long double wcstold(const wchar_t* restrict, wchar_t** restrict);
|
||||
long long wcstoll(const wchar_t* restrict, wchar_t** restrict, int);
|
||||
long wcstol(const wchar_t* restrict, wchar_t** restrict, int);
|
||||
size_t mbrlen(const char* restrict, size_t, mbstate_t* restrict);
|
||||
size_t wcsftime(wchar_t* restrict, size_t, const wchar_t* restrict, const struct tm* restrict);
|
||||
size_t wcsxfrm(wchar_t* restrict, const wchar_t* restrict, size_t);
|
||||
unsigned long long wcstoull(const wchar_t* restrict, wchar_t** restrict, int);
|
||||
unsigned long wcstoul(const wchar_t* restrict, wchar_t** restrict, int);
|
||||
wchar_t* fgetws(wchar_t* restrict, int, FILE* restrict);
|
||||
int wprintf(const wchar_t* __restrict, ...);
|
||||
int wscanf(const wchar_t* __restrict, ...);
|
||||
long double wcstold(const wchar_t* __restrict, wchar_t** __restrict);
|
||||
long long wcstoll(const wchar_t* __restrict, wchar_t** __restrict, int);
|
||||
long wcstol(const wchar_t* __restrict, wchar_t** __restrict, int);
|
||||
size_t mbrlen(const char* __restrict, size_t, mbstate_t* __restrict);
|
||||
size_t wcsftime(wchar_t* __restrict, size_t, const wchar_t* __restrict, const struct tm* __restrict);
|
||||
size_t wcsxfrm(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
||||
unsigned long long wcstoull(const wchar_t* __restrict, wchar_t** __restrict, int);
|
||||
unsigned long wcstoul(const wchar_t* __restrict, wchar_t** __restrict, int);
|
||||
wchar_t* fgetws(wchar_t* __restrict, int, FILE* __restrict);
|
||||
wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
|
||||
wchar_t* wcsstr(const wchar_t* restrict, const wchar_t* restrict);
|
||||
wchar_t* wcsstr(const wchar_t* __restrict, const wchar_t* __restrict);
|
||||
wchar_t* wcswcs(const wchar_t*, const wchar_t*);
|
||||
wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
|
||||
wchar_t* wmemcpy(wchar_t* restrict, const wchar_t* restrict, size_t);
|
||||
wchar_t* wmemcpy(wchar_t* __restrict, const wchar_t* __restrict, size_t);
|
||||
wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
|
||||
wchar_t* wmemset(wchar_t*, wchar_t, size_t);
|
||||
wint_t btowc(int);
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#undef restrict
|
||||
#define restrict __restrict__
|
||||
|
||||
#if 8 < __SIZEOF_LONG__
|
||||
#error unsigned long is bigger than expected, please add support to this file.
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue