Skip to content

Commit

Permalink
Merge pull request #1127 from Qwinci/reserved-renames
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke authored Sep 23, 2024
2 parents 410f21f + 65417f2 commit 3fbcf62
Show file tree
Hide file tree
Showing 129 changed files with 1,505 additions and 1,484 deletions.
2 changes: 1 addition & 1 deletion options/ansi/generic/stdio-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ size_t fwrite_unlocked(const void *buffer, size_t size, size_t count, FILE *file
}
}

char *fgets_unlocked(char *__restrict buffer, int max_size, FILE *stream) {
char *fgets_unlocked(char *__restrict buffer, int max_size, FILE *__restrict stream) {
__ensure(max_size > 0);
for(int i = 0; ; i++) {
if(i == max_size - 1) {
Expand Down
17 changes: 9 additions & 8 deletions options/ansi/generic/stdlib-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ long long atoll(const char *string) {
int sigprocmask(int, const sigset_t *__restrict, sigset_t *__restrict);
extern "C" {
__attribute__((__returns_twice__)) int __sigsetjmp(sigjmp_buf buffer, int savesigs) {
buffer[0].savesigs = savesigs;
buffer[0].__savesigs = savesigs;
if (savesigs)
sigprocmask(0, NULL, &buffer[0].sigset);
sigprocmask(0, NULL, &buffer[0].__sigset);
return 0;
}
}

__attribute__((__noreturn__)) void siglongjmp(sigjmp_buf buffer, int value) {
if (buffer[0].savesigs)
sigprocmask(SIG_SETMASK, &buffer[0].sigset, NULL);
if (buffer[0].__savesigs)
sigprocmask(SIG_SETMASK, &buffer[0].__sigset, NULL);
jmp_buf b;
b[0].reg_state = buffer[0].reg_state;
b[0].__reg_state = buffer[0].__reg_state;
longjmp(b, value);
}

Expand Down Expand Up @@ -438,7 +438,7 @@ int wctomb(char *, wchar_t) {
__builtin_unreachable();
}

size_t mbstowcs(wchar_t *wcs, const char *mbs, size_t wc_limit) {
size_t mbstowcs(wchar_t *__restrict wcs, const char *__restrict mbs, size_t wc_limit) {
auto cc = mlibc::current_charcode();
__mlibc_mbstate st = __MLIBC_MBSTATE_INITIALIZER;
mlibc::code_seq<const char> nseq{mbs, nullptr};
Expand All @@ -462,8 +462,9 @@ size_t mbstowcs(wchar_t *wcs, const char *mbs, size_t wc_limit) {
}
}

size_t wcstombs(char *mb_string, const wchar_t *wc_string, size_t max_size) {
return wcsrtombs(mb_string, &wc_string, max_size, 0);
size_t wcstombs(char *__restrict mb_string, const wchar_t *__restrict wc_string, size_t max_size) {
const wchar_t *wcs = wc_string;
return wcsrtombs(mb_string, &wcs, max_size, 0);
}

void free(void *ptr) {
Expand Down
14 changes: 7 additions & 7 deletions options/ansi/generic/wchar-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int mbsinit(const mbstate_t *stp) {
return !stp->__progress && !stp->__shift;
}

size_t mbrlen(const char *mbs, size_t mb_limit, mbstate_t *stp) {
size_t mbrlen(const char *__restrict mbs, size_t mb_limit, mbstate_t *__restrict stp) {
auto cc = mlibc::current_charcode();
wchar_t wc;

Expand All @@ -59,7 +59,7 @@ size_t mbrlen(const char *mbs, size_t mb_limit, mbstate_t *stp) {
return nseq.it - mbs;
}

size_t mbrtowc(wchar_t *wcp, const char *mbs, size_t mb_limit, mbstate_t *stp) {
size_t mbrtowc(wchar_t *__restrict wcp, const char *__restrict mbs, size_t mb_limit, mbstate_t *__restrict stp) {
auto cc = mlibc::current_charcode();

if(!stp)
Expand Down Expand Up @@ -92,7 +92,7 @@ size_t mbrtowc(wchar_t *wcp, const char *mbs, size_t mb_limit, mbstate_t *stp) {
}
}

size_t wcrtomb(char *mbs, wchar_t wc, mbstate_t *stp) {
size_t wcrtomb(char *__restrict mbs, wchar_t wc, mbstate_t *__restrict stp) {
auto cc = mlibc::current_charcode();

// wcrtomb() always takes a mbstate_t.
Expand All @@ -114,7 +114,7 @@ size_t wcrtomb(char *mbs, wchar_t wc, mbstate_t *stp) {
}
}

size_t mbsrtowcs(wchar_t *wcs, const char **mbsp, size_t wc_limit, mbstate_t *stp) {
size_t mbsrtowcs(wchar_t *__restrict wcs, const char **__restrict mbsp, size_t wc_limit, mbstate_t *__restrict stp) {
__ensure(mbsp);

auto cc = mlibc::current_charcode();
Expand Down Expand Up @@ -144,7 +144,7 @@ size_t mbsrtowcs(wchar_t *wcs, const char **mbsp, size_t wc_limit, mbstate_t *st
}
}

size_t mbsnrtowcs(wchar_t *wcs, const char **mbsp, size_t mb_limit, size_t wc_limit, mbstate_t *stp) {
size_t mbsnrtowcs(wchar_t *__restrict wcs, const char **__restrict mbsp, size_t mb_limit, size_t wc_limit, mbstate_t *__restrict stp) {
__ensure(mbsp);

auto cc = mlibc::current_charcode();
Expand Down Expand Up @@ -174,7 +174,7 @@ size_t mbsnrtowcs(wchar_t *wcs, const char **mbsp, size_t mb_limit, size_t wc_li
}
}

size_t wcsrtombs(char *mbs, const wchar_t **wcsp, size_t mb_limit, mbstate_t *stp) {
size_t wcsrtombs(char *__restrict mbs, const wchar_t **__restrict wcsp, size_t mb_limit, mbstate_t *__restrict stp) {
__ensure(wcsp && "wcsrtombs() with null input");
auto cc = mlibc::current_charcode();
mlibc::code_seq<const wchar_t> wseq{*wcsp, nullptr};
Expand Down Expand Up @@ -203,7 +203,7 @@ size_t wcsrtombs(char *mbs, const wchar_t **wcsp, size_t mb_limit, mbstate_t *st
}
}

size_t wcsnrtombs(char *mbs, const wchar_t **wcsp, size_t wc_limit, size_t mb_limit, mbstate_t *stp) {
size_t wcsnrtombs(char *__restrict mbs, const wchar_t **__restrict wcsp, size_t wc_limit, size_t mb_limit, mbstate_t *__restrict stp) {
__ensure(wcsp && "wcsrtombs() with null input");
auto cc = mlibc::current_charcode();
mlibc::code_seq<char> nseq{mbs, mbs + mb_limit};
Expand Down
100 changes: 50 additions & 50 deletions options/ansi/include/complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,106 +24,106 @@ extern "C" {

/* 7.3.5 Trigonometric functions */
/* 7.3.5.1 The cacos functions */
double complex cacos(double complex);
float complex cacosf(float complex);
double complex cacos(double complex __x);
float complex cacosf(float complex __x);

/* 7.3.5.2 The casin functions */
double complex casin(double complex);
float complex casinf(float complex);
double complex casin(double complex __x);
float complex casinf(float complex __x);

/* 7.3.5.1 The catan functions */
double complex catan(double complex);
float complex catanf(float complex);
double complex catan(double complex __x);
float complex catanf(float complex __x);

/* 7.3.5.1 The ccos functions */
double complex ccos(double complex);
float complex ccosf(float complex);
double complex ccos(double complex __x);
float complex ccosf(float complex __x);

/* 7.3.5.1 The csin functions */
double complex csin(double complex);
float complex csinf(float complex);
double complex csin(double complex __x);
float complex csinf(float complex __x);

/* 7.3.5.1 The ctan functions */
double complex ctan(double complex);
float complex ctanf(float complex);
double complex ctan(double complex __x);
float complex ctanf(float complex __x);

/* 7.3.6 Hyperbolic functions */
/* 7.3.6.1 The cacosh functions */
double complex cacosh(double complex);
float complex cacoshf(float complex);
double complex cacosh(double complex __x);
float complex cacoshf(float complex __x);

/* 7.3.6.2 The casinh functions */
double complex casinh(double complex);
float complex casinhf(float complex);
double complex casinh(double complex __x);
float complex casinhf(float complex __x);

/* 7.3.6.3 The catanh functions */
double complex catanh(double complex);
float complex catanhf(float complex);
double complex catanh(double complex __x);
float complex catanhf(float complex __x);

/* 7.3.6.4 The ccosh functions */
double complex ccosh(double complex);
float complex ccoshf(float complex);
double complex ccosh(double complex __x);
float complex ccoshf(float complex __x);

/* 7.3.6.5 The csinh functions */
double complex csinh(double complex);
float complex csinhf(float complex);
double complex csinh(double complex __x);
float complex csinhf(float complex __x);

/* 7.3.6.6 The ctanh functions */
double complex ctanh(double complex);
float complex ctanhf(float complex);
double complex ctanh(double complex __x);
float complex ctanhf(float complex __x);

/* 7.3.7 Exponential and logarithmic functions */
/* 7.3.7.1 The cexp functions */
double complex cexp(double complex);
float complex cexpf(float complex);
double complex cexp(double complex __x);
float complex cexpf(float complex __x);

/* 7.3.7.2 The clog functions */
double complex clog(double complex);
float complex clogf(float complex);
double complex clog(double complex __x);
float complex clogf(float complex __x);

/* 7.3.8 Power and absolute-value functions */
/* 7.3.8.1 The cabs functions */
/*#ifndef __LIBM0_SOURCE__ */
/* avoid conflict with historical cabs(struct complex) */
/* double cabs(double complex) __RENAME(__c99_cabs);
float cabsf(float complex) __RENAME(__c99_cabsf);
/* double cabs(double complex __x) __RENAME(__c99_cabs);
float cabsf(float complex __x) __RENAME(__c99_cabsf);
#endif
*/
double cabs(double complex) ;
float cabsf(float complex) ;
double cabs(double complex __x);
float cabsf(float complex __x);

/* 7.3.8.2 The cpow functions */
double complex cpow(double complex, double complex);
float complex cpowf(float complex, float complex);
double complex cpow(double complex __x, double complex __y);
float complex cpowf(float complex __x, float complex __y);

/* 7.3.8.3 The csqrt functions */
double complex csqrt(double complex);
float complex csqrtf(float complex);
double complex csqrt(double complex __x);
float complex csqrtf(float complex __x);

/* 7.3.9 Manipulation functions */
/* 7.3.9.1 The carg functions */
double carg(double complex);
float cargf(float complex);
double carg(double complex __x);
float cargf(float complex __x);

/* 7.3.9.2 The cimag functions */
double cimag(double complex);
float cimagf(float complex);
long double cimagl(long double complex);
double cimag(double complex __x);
float cimagf(float complex __x);
long double cimagl(long double complex __x);

/* 7.3.9.3 The conj functions */
double complex conj(double complex);
float complex conjf(float complex);
/*long double complex conjl(long double complex); */
double complex conj(double complex __x);
float complex conjf(float complex __x);
/*long double complex conjl(long double complex __x); */

/* 7.3.9.4 The cproj functions */
double complex cproj(double complex);
float complex cprojf(float complex);
/*long double complex cprojl(long double complex); */
double complex cproj(double complex __x);
float complex cprojf(float complex __x);
/*long double complex cprojl(long double complex __x); */

/* 7.3.9.5 The creal functions */
double creal(double complex);
float crealf(float complex);
long double creall(long double complex);
double creal(double complex __x);
float crealf(float complex __x);
long double creall(long double complex __x);

#endif /* !__MLIBC_ABI_ONLY */

Expand Down
30 changes: 15 additions & 15 deletions options/ansi/include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ extern "C" {
#ifndef __MLIBC_ABI_ONLY

// Character classification function [7.4.1]
int isalnum(int c);
int isalpha(int c);
int isblank(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
int isalnum(int __c);
int isalpha(int __c);
int isblank(int __c);
int iscntrl(int __c);
int isdigit(int __c);
int isgraph(int __c);
int islower(int __c);
int isprint(int __c);
int ispunct(int __c);
int isspace(int __c);
int isupper(int __c);
int isxdigit(int __c);

// glibc extensions.
int isascii(int c);
int isascii(int __c);

// Character case mapping functions [7.4.2]
int tolower(int c);
int toupper(int c);
int tolower(int __c);
int toupper(int __c);

#endif /* !__MLIBC_ABI_ONLY */

Expand Down
20 changes: 10 additions & 10 deletions options/ansi/include/fenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ typedef __mlibc_uint16 fexcept_t;

#ifndef __MLIBC_ABI_ONLY

int feclearexcept(int);
int fegetenv(fenv_t *);
int fegetexceptflag(fexcept_t *, int);
int feclearexcept(int __excepts);
int fegetenv(fenv_t *__envp);
int fegetexceptflag(fexcept_t *__envp, int __excepts);
int fegetround(void);
int feholdexcept(fenv_t *);
int feraiseexcept(int);
int fesetenv(const fenv_t *);
int fesetexceptflag(const fexcept_t *, int);
int fesetround(int);
int fetestexcept(int);
int feupdateenv(const fenv_t *);
int feholdexcept(fenv_t *__envp);
int feraiseexcept(int __excepts);
int fesetenv(const fenv_t *__envp);
int fesetexceptflag(const fexcept_t *__envp, int __excepts);
int fesetround(int __round);
int fetestexcept(int __excepts);
int feupdateenv(const fenv_t *__envp);

#endif /* !__MLIBC_ABI_ONLY */

Expand Down
12 changes: 6 additions & 6 deletions options/ansi/include/inttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ typedef struct {

#ifndef __MLIBC_ABI_ONLY

intmax_t imaxabs(intmax_t);
imaxdiv_t imaxdiv(intmax_t, intmax_t);
intmax_t strtoimax(const char *__restrict, char **__restrict, int);
uintmax_t strtoumax(const char *__restrict, char **__restrict, int);
intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int);
uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
intmax_t imaxabs(intmax_t __x);
imaxdiv_t imaxdiv(intmax_t __x, intmax_t __y);
intmax_t strtoimax(const char *__restrict __string, char **__restrict __end, int __base);
uintmax_t strtoumax(const char *__restrict __string, char **__restrict __end, int __base);
intmax_t wcstoimax(const wchar_t *__restrict __string, wchar_t **__restrict __end, int __base);
uintmax_t wcstoumax(const wchar_t *__restrict __string, wchar_t **__restrict __end, int __base);

#endif /* !__MLIBC_ABI_ONLY */

Expand Down
2 changes: 1 addition & 1 deletion options/ansi/include/locale.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct lconv {

// [C11/7.11.1] setlocale() function

char *setlocale(int category, const char *locale);
char *setlocale(int __category, const char *__locale);

// [C11/7.11.2] Locale inquiry function

Expand Down
Loading

0 comments on commit 3fbcf62

Please sign in to comment.